1. Introduction

Compared with analog lock-in amplifier, digital lock-in amplifier has the characteristics of stability, high precision and obvious advantages in frequency scanning. Based on TDLAS (tunable diode laser absorption) Spectrum technology uses the frequency modulation technology to inject sine wave current into the laser diode for frequency modulation, uses the frequency doubling signal of the modulation frequency as the reference signal, uses the lock-in amplifier to lock the concerned second harmonic signal, and uses the lock-in amplifier designed by DSP to detect the second harmonic, so that the measurement system has high sensitivity, accurate resolution and high dynamic performance Response speed.

2. Principle of digital lock in amplifier

Design and application analysis of digital lock in amplifier based on DSP Technology

The software design of DSP digital lock-in amplifier can be used from Figure 1. The software structure flow of the whole system is shown in Figure 2

The locking algorithm program is as follows:

Void main()


………。 / / system initialization, variable definition and initialization, omitted

//A reference sine and a reference cosine with the frequency of F Hz (here the second harmonic frequency of the laser signal) are generated.


Sigfilter(); / / filter out the noise by using the filter library provided by Ti

Correlate(); / / correlation operation




………。 //Follow up processing: display output, feedback control, etc


The subroutines of generating reference signal and related calculation are as follows:

void RefWave(f)


for(i=0; i《f; i++)


x = _ IQ (pi * I / 10); / / according to the formula (2) in this paper, the value of n is 20

sinx[i] = _ Iqsin (x); / / uses Q format operation, because 2812 is a fixed-point DSP

cosx[i] = _ IQcos(x);



void Correlate()


For (I = 0; I “n; I + +) / / N is the sample number of integration time


//Carry out multiplication and addition_ The function of iqtoiq20 is to prevent overflow

temp1 += _ IQ20mpy(_ IQtoIQ20(input[i]), _ IQtoIQ20(sinx[i]));

temp2 += _ IQ20mpy(_ IQtoIQ20(input[i]), _ IQtoIQ20(cosx[i]));


M = _ Iq20 (m); / / M sampling points of the signal

temp1 = _ Iq20div (temp1, m); / / formula (3)

Rxrs = _ Iq20toiq (temp1); / / sine cross correlation results

temp2 = _ IQ20div(temp2, M);

Rxrc = _ Iq20toiq (temp2); / / cosine cross correlation results


3. Application of digital lock in amplifier in TDLAS measurement system

Fig. 3 is a system block diagram for measuring the concentration of automobile exhaust gas by laser.

This system uses TDLAS principle to measure the concentration of carbon dioxide in the tail of automobile emission. The laser source of TDLAS (tunable diode laser absorption spectroscopy) measurement system is produced by a commercial tunable laser diode. The nlk1556stg butterfly laser diode with a reference wavelength of 1583.69nm and an adjustable output wavelength is used. Its output power and wavelength are determined by the laser controller ldc-3724b. The output beam changes into two beams after passing through a 50 / 50 splitter. One beam directly enters the self balancing receiver, and the other beam is aimed by the sight. After passing through the sample gas chamber, it is received by the optical fiber and enters the self balancing receiver. The self balancing receiver adopts the model of new focus company In 2017, the common mode rejection ratio of the self balanced receiver can reach 50dB, which can eliminate the noise of two beams, and reduce the requirements for the dynamic range and linearity of the lock-in amplifier. The output of the self balanced receiver is used as the input of the lock-in amplifier. The lock-in amplifier adopts the digital design method described in the previous part of this paper. First, the analog signal output by the self balanced receiver is sampled by the ADC, and then the second harmonic signal component of the measured signal is locked by the lock-in core algorithm in TMS320F2812. Finally, the measurement result is calculated and output according to Lambert Beer law. While processing the signal, DSP is used to generate 30kHz sine signal and 50Hz slope signal as the modulation signal of laser diode.

4. Experimental results

With the help of the powerful data processing ability of TMS320F2812 and the use of correlation algorithm and filtering algorithm, the detection ability of digital lock-in amplifier for weak signal has been greatly improved compared with the traditional analog lock-in amplifier, and its noise suppression ability Q value can reach 106. The digital lock-in amplifier designed in this paper is applied in the second harmonic detection system based on TDLAS, and its detection accuracy can reach 10ppb. When applied to the automobile exhaust measurement system, it can detect the gas concentration in real time and get the results. The digital lock-in amplifier designed by DSP is of great significance for the weak laser signal in the automobile exhaust detection system and the research of new control strategy for the dynamic emission law of automobile exhaust.

Editor in charge: GT

Leave a Reply

Your email address will not be published. Required fields are marked *