## 2 Materials and Methods
Therefore a phase setting optimized for a fixed concentration is valid for a limited range of the mentioned parameters only. This partially limits the advantage of the modulation frequency auto tracking: instead of the realignment of the frequency a realignment of the phase is needed. In this paper however, we report on the ability of a continuous phase modulation instead of a fixed setting which yields a steady measurement and additionally separates the photo-acoustically induced amplitude from the offset generated by the oscillator circuit. Figure 1: Generated signal amplitude at the lock-in-amplifier for photoacoustic excitation (open red squares), electrical excitation (solid green squares), and simultaneous excitation (green filled red squares). The latter depends on the phase between the two driving forces. Figure 2b depicts how the auto-triggered QEPAS setup can be extended to avoid the critical phase alignment. Instead of setting a fixed delay the phase is continuously modulated between 0 and 360\({}^{\circ}\) with a frequency f\({}_{\text{phs}}\) = 0.37 Hz which is considerably smaller than the resonance frequency of the tuning fork. The output (A) of the first lock-in amplifier is fed to the input of a second lock-in amplifier which is referenced with the phase modulation frequency f\({}_{\text{phs}}\). Without target molecules present in the spectrophone, signal (A) represents the amplitude induced by the oscillator circuit only. It is not modulated and thus output (B) of the second lock-in-amplifier is zero. Upon absorption, signal (A) starts oscillating with the frequency f\({}_{\text{phs}}\) and the photo-acoustically induced amplitude. The output of the second lock-in amplifier (B) shows the oscillation amplitude of (A), i.e., the pure photo-acoustic amplitude without electrically induced offset. The functionality of the two lock-in stages was incorporated into one device developed by KNESTEL Technologie & Elektronik GmbH. The device consists of a combination of a micro controller and a FPGA where the functionality of both lock-in amplifiers and phase modulation is digitally programmed. For the measurements detailed in Section 3, a pulsed external cavity QCL provided by the Fraunhofer IAF was used because it covers both, methane and ammonia which are important for biogas measurements. The laser emits pulses at a repetition rate f\({}_{\text{rep}}\) = 400 kHz and is over-modulated with a TTL signal with a duty cycle of roughly 30% (either generated by the oscillator circuit or manually set) thus releasing four laser pulses during each high-level. The laser can be tuned in the frequency range 980 cm\({}^{-1}\)-1290 cm\({}^{-1}\). A spectrophone without acoustic resonators was used for the measurements, which were conducted at ambient pressure and room temperature. Figure 2: Schematic of the setup for modulation frequency auto tracking: (**a**) the tuning fork oscillator adjusts to the present resonance frequency. This is fed as reference to the lock-in amplifier and with a manually set (fixed) phase to the laser driver for modulation. The signal output at the lock-in is the sum of photoacoustic and electrical excitation. (**b**) A second lock-in amplifier is added to the setup and the phase of the laser modulation is modulated with a lower frequency. Thus the signal A of the first lock-in shows a sinusoidal variation (left inset). The second lock-in demodulates and amplifies this signal and yields a constant signal B (right inset) which is proportional to the sole photoacoustic excitation.