1 Introduction

Photoacoustic (PA) spectroscopy is widely used for tracing gas analysis [1, 2]. The influence of noise becomes more significant when the concentration of target gas decreases. Any acoustic fluctuation picked up by the acoustic sensor (typical microphone) might be recognized as a PA signal. It can be a signal either from the measured sample (gas, solid, liquid) or from external acoustic noise. One of the most common methods used to improve the signal-to-noise ratio (SNR) is to place measured specimens into the cell [3, 4]. In this method, the cell is sealed both electrically and acoustically; thus, the measured gas and the acoustic sensor are separated from external interferences. In this way, the sample is isolated from the acoustic signals from the surrounding environment and the level of the background noise is also reduced. In PA constructions, two approaches are used. The first one is to operate at the frequency located far away from the resonant frequency of the cell [5, 6], while the second one, on the contrary to the previous one, operates at the resonant frequency [7]. Both solutions have their advantages and disadvantages. The first approach does not require tuning of the stimulating frequency; however, it also does not use the cell resonance properties. The cell allows the amplitudes at frequencies around the resonance frequency to pass through and attenuates amplitudes at frequencies outside the resonance. Hence, the selectivity of frequencies can be used to attenuate amplitudes of external noise and to allow amplitudes of measured PA signal to pass through. The second solution requires knowledge of the actual resonant frequency of the cell and follows it by the stimulating frequency. This solution increases sensitivity significantly. However, the resonance frequency is affected by the environmental parameters (temperature) and the chemical composition of the gas mixture. That is why, its variations may become a significant problem. So several methods are used to determine the actual resonant frequency and a tracking method in PA systems. In these methods:

  1. (a)

    the resonance frequency change can be calculated from the measured temperature [8],

  2. (b)

    inside the cell, there is a speaker [9,10,11] which is used to determine the frequency response of the cell. The PA resonance frequency can be either directly measured or calculated from another mode since the ratio between modes is constant for the same cell [12],

  3. (c)

    the resonance frequency can be determined by estimating maximum amplitude based on the amplitude response obtained by:

    • measuring amplitudes at selected frequencies [13], frequency by frequency,

    • the pulse technique [14] measuring the amplitudes at several frequencies at the same time by using either the chirp technique [15] or by sweeping frequency,

  4. (d)

    by producing a PA signal based on the PA generator method [16, 17]. In this method, the intensity of the light beam is driven by the PA signal in the feedback loop. The stimulating frequency is self-adjusting to the actual conditions of the PA cell.

The last presented solution uses the PA signal from the microphone to drive the optical modulator which stimulates the PA cell. Such a system automatically adjusts the stimulating frequency to the resonant frequency of the cell. However, the PA generator requires a strong PA signal from the measured sample to produce oscillation. This phenomenon limits generator practical application.

2 The Description of a Proposed Method

The standard PA measurement system is presented in Fig. 1a [12, 18]. It is based on a PA cell which contains the measured sample, a light source (eg., laser or LED) with an externally triggered optical modulator and an acoustic sensor connected to the cell. The acoustic signal induced by the photoacoustic effect is changed by an acoustic sensor (eg., microphone) into an electrical signal. In order to increase the level of the photoacoustic signal, a preamplifier is used. Then, the signal is changed into a digital one by an analog to digital converter (ADC). In most PA systems, the stored samples are processed by a digital signal processor (DSP) which calculates the amplitude response and controls the function generator frequency.

The PA cell is stimulated by a light beam from a light source which signal is modulated by the function generator. In certain applications, the lock-in amplifier is used instead of a control unit and a data acquisition module (DAQ) [19, 20]. Such a solution is presented in Fig. 1b.

The proposed method describes another approach to the control and data acquisition module. To track or monitor the resonance frequency of the cell, the phase relation between stimulating and measured signal is used instead of the amplitude response. This approach uses the phase which value is zero at the resonant frequency. Moreover, the relation between the phase and the amplitude response is constant and is independent of temperature and gas mixture. The example of the amplitude and phase response of the PA cell is presented in Fig. 2. At the same time, while the amplitude is obtained, the phase can also be determined. The described method uses input samples to calculate the amplitude, which is proportional to the absorption, and also phase to determine the correction of the stimulation frequency. If the phase is negative, then the stimulating frequency is increased; otherwise, the frequency is decreased.

3 Measurement Concept Based on Phase Response

The proposed method is based on the IQ demodulation technique. The block diagram of the method is presented in Fig. 3. As the figure shows, the PA signal is converted into the digital one by an ADC. This digital signal is connected to the input of two mixers (digital multipliers) where each mixer has two inputs and one output. The signal at the output is a multiplication of the signal at inputs. The input signal from the converter is mixed with the signal generated by the numerical control oscillator (NCO).

The input signal from the ADC \(y_{RF}(t)\) can be described as:

$$\begin{aligned} y_{RF} (t)=A_{RF} \cdot \hbox {sin}(\omega _{RF} \cdot t+\varphi _{RF} ) \end{aligned}$$
(1)

and the signal from the NCO is described as:

$$\begin{aligned} y_{LO} (t)=A_{LO} \cdot \hbox {sin}(\omega _{LO} \cdot t+\varphi _{LO} ) \end{aligned}$$
(2)

the mixer output is described as [21]:

$$\begin{aligned} y_{IF} (t)= & {} y_{RF} (t)\cdot y_{LF} (t)\nonumber \\= & {} {0.5}\cdot A_{LO} \cdot A_{RF} \cdot \left( \hbox {sin}\left[ {(\omega _{RF} +\omega _{LO} )\cdot t+(\varphi _{RF} +\varphi _{LO} )} \right] \right. \nonumber \\&\left. +\,\hbox {sin}\left[ {(\omega _{RF} -\omega _{LO} )\cdot t+(\varphi _{RF} -\varphi _{LO})} \right] \right) \end{aligned}$$
(3)

where

$$\begin{aligned} \omega =\hbox {2}\cdot \pi \cdot f \end{aligned}$$
(4)

The mixer output contains two frequencies \(f_{RF}+f_{LO}\) and \(f_{RF}-f_{LO}\), and since the stimulating frequency (NCO) and measured frequency are the same, the \(f_{RF}=f_{LO}\) and Eq. 3 have the form

$$\begin{aligned} ={0.5}\cdot A_{LO} \cdot A_{RF} \cdot \left( {\hbox {sin}\left[ {{2}\cdot \omega _{LO} \cdot t+(\varphi _{RF} +\varphi _{LO} )} \right] +\hbox {sin}(\varphi _{RF} -\varphi _{LO} )} \right) \end{aligned}$$
(5)

The low-frequency component is responsible for the phase difference and is extracted by the low-pass filters (LPF). The Cartesian representation enables us to calculate the amplitude as:

$$\begin{aligned} A=\sqrt{I{^\prime }^{2}+Q{^\prime }^{2}} \end{aligned}$$
(6)

and a phase difference as:

$$\begin{aligned} \varphi =a \hbox { tan}\left( {\frac{Q^{\prime }}{I^{\prime }}} \right) \end{aligned}$$
(7)

To change the stimulation frequency, the phase difference is used to determine the frequency corrections for the NCO. In order to improve SNR, a dedicated module which implements low-pass filtering and averaging (LPF & AVG) was added. This module allows to set the average number in the presented method. Depending on it, the phase difference measurement may be more accurate, which is important for the measurement of very weak PA signals. The control module checks the phase and depending on its value changes the frequency of the NCO. The output of the NCO is connected to the digital comparator (CMP) which drives the laser by a digital signal with 3.3-V level.

4 Verification

A typical PA cell was used to evaluate the proposed method. This cell is similar to the one used earlier in the measurement of the PA generator [17]. The block diagram of a photoacoustic system is presented in Fig. 1a. In the figure, instead of the block control & DAQ have been used two digital development boards and a custom-made analog board. Digital development board with field programmable gate array (FPGA) DE0-Nano was used to perform all signal processing operations. While the board with the microcontroller (STM32F411 Nucleo) was responsible for the communication between PC computer and a signal processing circuit.

The clock for the signal processing unit was set to 50 MHz and each processing signal block operated with the same frequency. The whole circuit worked in such a way that the processing speed was sufficient to finish all mathematical operations before processing next sample from an analog to digital converter. An analog custom-made board consisted of the ADC, an amplifier and analog filters. The signal from the microphone passed through the amplifier in order to increase the amplitude of the signal. And then this signal is passed through the analog filter to reduce its bandwidth. After the whole process, the analog signal was converted into a digital one by the 18-bit ADC and went to the FPGA board.

The picture of the described measurement setup is shown in Fig. 4. In order to verify a proposed method, graphite powder was placed into the cell to cause an absorption of the light. At the beginning of tests, the PA cell was filled with nitrogen, and after a few seconds measurements were started. The resonance frequency of the cell filled with nitrogen was stabilized at 1395 Hz. In order to evaluate the proposed method, the speed of sound in the cell was changed by portion of carbon dioxide injected into the cell. This procedure was repeated five times. During all tests, the resonance frequency and the phase were recorded and obtained results are shown in Fig. 5. Every time after injection, the phase suddenly changed and then after a few seconds returned to the initial value. The variance of the phase in each test was in the range of 1 degree while the resonance frequency changed from 1089 Hz to 1395 Hz.

Fig. 1
figure 1

Block diagram of a standard photoacoustic system (a), a system with the lock-in amplifier (b)

Fig. 2
figure 2

Measured frequency dependence of amplitude (a) and phase (b) of the photoacoustic cell

Fig. 3
figure 3

Block diagram of proposed method

Fig. 4
figure 4

Photograph of the measurement setup

Fig. 5
figure 5

Generated frequency of the light beam source (a), the phase difference between measured from the photoacoustic signal and set from reference measurement (b)

5 Conclusions

In this paper, a new approach to overcome problem of the tracking resonance frequency of the PA cell was proposed. This method is based on the measurement of the phase difference between the stimulating light source and the signal from the microphone. Depending on the phase between both signals, the stimulating frequency increases or decreases. The method tries to maintain the constant zero phase between both signals. Measuring of both the amplitude and the phase can be performed using the same data. Moreover, our approach allows us to use low-pass filters and the average algorithm on the calculated phase and amplitude. Similar signal processing algorithms are used in lock-in amplifiers; thus, the SNR can be improved and the detection sensitivity can be enhanced in this way.

The performed measurements allowed us to verify the proposed method. The PA cell was filled with nitrogen, and later carbon dioxide was injected into the cell five times. So, consequently every gas injection changed the resonance frequency. Each time the stimulating frequency was adapted to the resonance frequency of the cell based on the phase response.