Next Article in Journal
Performance Prediction of High-Speed Hydrogen Gas-Lubricated Herringbone Grooved Journal Bearing
Next Article in Special Issue
Impact Load Sparse Recognition Method Based on Mc Penalty Function
Previous Article in Journal
Study on the Determination Method of Cast Blasting Stockpile Forms in an Open-Pit Mine
Previous Article in Special Issue
A Current Sharing State Estimation Method of Redundant Switched-Mode Power Supply Based on LSTM Neural Network
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Software Digital Lock-In Amplifier Method with Automatic Frequency Estimation for Low SNR Multi-Frequency Signal

1
School of Automation Engineering, University of Electronic Science and Technology of China, Chengdu 611731, China
2
Sichuan Forestry and Grassland Inventory and Planning Institute, Chengdu 611731, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2022, 12(13), 6431; https://doi.org/10.3390/app12136431
Submission received: 20 May 2022 / Revised: 17 June 2022 / Accepted: 21 June 2022 / Published: 24 June 2022

Abstract

:
In the fault diagnosis field, the fault feature signal is weak and contaminated by the noise. The lock-in amplifier is a useful tool for weak signal detection. Aiming to the amplitude error of the lock-in amplifier caused by frequency deviation between the measured signal and the reference signal, a DFT-based automatic signal frequency estimation method is studied to improve the frequency accuracy of the reference signal. Based on this frequency estimation method, a software digital lock-in amplifier method is proposed to detect the multiple frequencies signals. This proposed method can automatically measure the frequency value of the measured signal without prior frequency information. Then, the reference signals are generated through this frequency value to make the digital lock-in amplifier estimate the amplitude of the measured signal. Moreover, an iterative structure is used to implement the multiple frequencies signal measurement. The frequencies and amplitudes measurement accuracies are tested. Under different SNR conditions, the frequency relative error is less than 0.1 % . In addition, the amplitude relative error with different signal frequencies is less than 1.7 % when the SNR is −1 dB. This proposed software digital lock-in amplifier method has a higher signal frequency tracking ability and amplitude measurement accuracy.

1. Introduction

Rolling bearing is the most important component of machines in both industrial machinery and household equipment. The fault diagnosis of rolling bearing is necessary for the operation of machinery and to prevent property loss and dangerous situations [1,2,3,4]. Many scholars have studied various fault identification and classification methods [5,6,7]. However, signal acquisition, noise separation, and signal parameter estimation are the most critical segments for fault diagnosis due to the feature signal being typically weak and polluted by noise.
Weak signal detection and parameter estimation methods in complex noise environments have been widely used in other fields, such as scientific research [8,9], bioscience [10], chemistry [11], and so on. To extract enough useful information from the low signal-to-noise ratio (SNR) signals, researchers proposed a variety of detection methods from the aspect of linear theory, such as time-frequency analysis and adaptive filters [12], to the aspect of nonlinear theory, such as the chaos system [13], stochastic resonance [14], and machine learning methods [15].
The lock-in amplifier (LIA) is a mature weak signal detection method extensively used in spectroscopy signal analysis [16] and atom spin gyroscope signal processing [17]. The LIA uses the principle that the measured signal is not correlated with noise. The measured low SNR signal with known frequency is multiplied by a reference signal with the same frequency to achieve frequency shifting. Then, a lowpass filter is used to filter the noise and high-frequency component to obtain the DC part which is proportional to the amplitude of the detected low SNR signal. Due to the LIA having a strong noise inhibition ability and high reliability, companies and scholars proposed many LIA applications and modified structures. Masciotti et al. [18] proposed a matrix version of a digital LIA (DLIA) which is used to simultaneously estimate the amplitudes and phases of a multiple frequencies signal of the optical tomography. Flater et al. [19] proposed a DLIA structure to process the multiple frequencies signal from the contact-resonance force microscopy. Stimpson et al. [20] designed a high-speed digital LIA structure based on an FPGA. Xinda Chen et al. [21] used the integral average filter as the lowpass filter to compress the filter bandwidth and improve the amplitude measurement accuracy of the DLIA. Alves et al. [22] designed a microcontroller-based dual-channel DLIA which enhanced the frequency resolution of the reference signal. Paulina Maya et al. [23] proposed a single-channel LIA using a phase shifter to eliminate the phase difference between the reference signal and the measured signal which is used to process the signal of the capacitance or resistance output sensor under the low power consumption condition.
Due to the analog LIA being easily affected by the temperature drift and time drift of the analog device, many researchers mainly focus on the specific digital LIA realized by a DSP, FPGA, MCU, and other digital chips, which is applied as a signal processing module in a dedicated research field or application [21]. One of the key factors affecting the amplitude measurement accuracy is the frequency error between the reference signal and the measured signal. Kai Xie et al. [24] analyzed the phase error of the DLIA output and proposed a reference signal frequency error tracking method that enhanced the amplitude measurement accuracy. However, this proposed frequency tracking method can only satisfy the small frequency variation condition and had a slow dynamic response. Cheng Zhang et al. [25] proposed an automatic frequency tracking structure based on Fast Fourier transform (FFT) and digital phase-locked loop (DPLL) on an FPGA chip to reduce the frequency error. These mentioned methods usually need to know the approximate frequency value of a single measured signal and then use some kind of frequency compensation strategies to diminish the frequency error between the reference signal and the measured signal.
In the actual application, the low SNR signal to be measured usually contains multiple frequency components [26], which need to compensate for the frequency errors of the reference signals and estimate the amplitude of each frequency component. The traditional DLIA needs a number of individual modules in parallel to realize the measurement of multiple frequency components, which increases the consumption of space and resources. For the parameter estimation issue of the low SNR signal with multiple frequency components, this paper proposed an iterative-based software implementation of the digital lock-in amplifier with automatic frequency estimation ability. For the low SNR measured signal with a known number of frequency components, this proposed method can automatically estimate the frequency value of each frequency component. Then, this frequency value is used to generate corresponding reference signals for the DLIA to estimate the amplitude information. Moreover, this software implementation structure increases the adaptability of the DLIA, and it can be easily modified to other applications as a pre-processing step to extract signal parameters for post-signal classification or other tasks.
In this article, the principles of the lock-in amplifier and frequency estimation method are discussed in Section 2. In Section 3, the necessary details that are used to implement the proposed method are stated. Then, we examine the frequencies and amplitudes estimation accuracy and the noise suppression ability of the proposed method in Section 4. Finally, we discuss the benefit of the proposed method and give a conclusion in Section 5.

2. Basic Theoretical Analysis

2.1. Principle of Lock-In Amplifier and Frequency Error Analysis

Supposing a low SNR periodic signal to be measured is:
s ( t ) = A sin ( 2 π f t + ϕ ) + n ( t )
where A is the amplitude of measured signal; f is the signal’s frequency; ϕ is the initial phase of measured signal; and n ( t ) is a Gaussian white noise which satisfies the Normal distribution. The mean value of n ( t ) is 0, and the variance of the noise n ( t ) is D 2 .
To avoid the phase difference between the reference signal and measured signal affecting the amplitude measurement of DLIA, the orthogonal DLIA structure is used as shown in Figure 1.
The orthogonal DLIA has two quadrature reference signals:
r c ( t ) = B cos ( 2 π f 1 t )
r s ( t ) = B sin ( 2 π f 1 t )
In Equation (2a,b), the B is the amplitude of reference signals; f 1 is the frequency of reference signals. The orthogonal DLIA multiplies to-be-detected signal s ( t ) by quadrature reference signals r c ( t ) and r s ( t ) separately to realize the spectrum shift. Ideally, the frequency of reference signal f 1 is identical to signal’s frequency f. Then, the results of these two multipliers can be obtained:
R s ( t ) = A · B 2 { cos ( ϕ ) cos ( 4 π f t + ϕ ) } + n ( t ) r s ( t )
R c ( t ) = A · B 2 { sin ( ϕ ) + sin ( 4 π f t + ϕ ) } + n ( t ) r c ( t )
From Equation (3), it can be seen that the measured signal has been moved to the DC region and high-frequency region, and the noise n ( t ) has also been moved. Therefore, a lowpass filter with a very narrow bandwidth is used to filter out the high-frequency component and noise. Typically, the integral average filter (IAF) [21] is used to realize the lowpass filter:
R ¯ s = 1 T 0 T R s ( t ) d t = A B 2 cos ( ϕ ) A B 2 T 0 T cos ( 4 π f t + ϕ ) d t + 1 T 0 T n ( t ) r s ( t ) d t
R ¯ c = 1 T 0 T R c ( t ) d t = A B 2 sin ( ϕ ) + A B 2 T 0 T sin ( 4 π f t + ϕ ) d t + 1 T 0 T n ( t ) r c ( t ) d t
where the T is the integral length which can be the period of measured signal or a constant integral length. Due to the Gaussian white noise not being correlated with the measured signal, the third term in Equation (4a,b) is zero in a specific integral length T, theoretically. When the IAF has a stable output, the Equation (4) can be simplified to:
R ¯ s = A B 2 cos ( ϕ ) + n ( t )
R ¯ c = A B 2 sin ( ϕ ) + n ( t )
where the n ( t ) is the residual noise in the actual situation due to the not-narrow-enough bandwidth of the lowpass filter. When the bandwidth of the lowpass filter is narrow enough, the residual noise n ( t ) is also very small that it can be ignored.
Then, the amplitude and initial phase of the to-be-detected signal can be obtained:
A = 2 B R ¯ s 2 + R ¯ c 2
ϕ = arctan ( R ¯ c R ¯ s )
In some specific applications, the measurement units or sensors are far from the DLIA of signal processing equipment. The sensors and the reference signal generator of DLIA may use separate clock sources. The frequency value of the to-be-detected signal depends on one of the clock sources which is used on the sensor side, for example, the non-dispersive-infrared (NDIR) ethylene gas detection application [27]. When the detection system uses different clock sources in long-distance measurement or offline measurement applications, the difference in frequency, accuracy, and drift under different operation conditions will lead to time-varying frequency deviation Δ f = f f 1 between the signal’s frequency f and reference frequency f 1 . This frequency deviation Δ f causes an additional amplitude measurement error which is irrelevant to the noise embedded in the measured signal.
Meanwhile, the amplitude-frequency characteristic of an actual lowpass filter is not flat in the passband. Assuming that the amplitude-frequency characteristic of a lowpass filter is | H L P ( 2 π Δ f ) | , and the small frequency deviation Δ f is in the passband, and ignoring the effect of noise in the measured signal, the output of lowpass filters of two orthogonal channels are:
R ¯ s ( t ) = A B 2 cos ( 2 π Δ f t + ϕ ) | H L P ( 2 π Δ f ) |
R ¯ c ( t ) = A B 2 sin ( 2 π Δ f t + ϕ ) | H L P ( 2 π Δ f ) |
Therefore, the measured amplitude of to-be-detected signal can be rewritten as:
A = 2 B R ¯ s 2 + R ¯ c 2 = A | H L P ( 2 π Δ f ) |
As shown in Equation (8), the actually measured amplitude of signal A ˜ has error due to the frequency deviation Δ f [28]. Furthermore, taking the IAF as an example for quantitatively analyzing the amplitude measurement error caused by frequency deviation Δ f , ignoring the noise n ( t ) , Equations (4) and (5) can be rewritten as:
R ¯ s = 1 T 1 0 T 1 R s ( t ) d t = A B 2 T 1 0 T 1 cos ( 2 π ( f f 1 ) t + ϕ ) cos ( 2 π ( f + f 1 ) t + ϕ ) d t = A B π f 1 2 f 2 f 1 2 cos ( π f f 1 f 1 + ϕ ) sin ( π f f 1 f 1 )
R ¯ c = 1 T 1 0 T 1 R c ( t ) d t = A B 2 T 1 0 T 1 sin ( 2 π ( f f 1 ) t + ϕ ) + sin ( 2 π ( f + f 1 ) t + ϕ ) d t = A B π f f 1 f 2 f 1 2 sin ( π f f 1 f 1 + ϕ ) sin ( π f f 1 f 1 )
where the integral length T 1 = 1 f 1 is the period of reference signals. Then, the amplitude estimation value with frequency deviation Δ f can be obtained [28]:
A = 2 B R ¯ s 2 + R ¯ c 2 = | 2 A f 1 π ( f 2 f 1 2 ) sin ( π f f 1 f 1 ) | ( f 2 f 1 2 ) sin 2 ( π f f 1 f 1 + ϕ ) + f 1 2 = 2 A | sin ( π r f ) π r f | 1 + r f ( 2 + r f ) sin 2 ( π r f + ϕ ) 2 + r f
In Equation (10), r f = f f 1 f 1 is the relative frequency deviation. Assuming the measured signal’s initial phase is ϕ = 0 and the relative frequency deviation r f is very small, which is from 0.1 to 0.1 , the relative amplitude error caused by r f is shown in Figure 2a. The relative amplitude error is monotonically increasing in this small range. Due to the existence of frequency deviation r f , the relative amplitude error is affected by the initial phase of the measured signal. If the relative frequency deviation r f is fixed and equals 0.001 , the relative amplitude error varies periodically with the change of the initial phase of the signal as shown in Figure 2b.

2.2. Frequency Estimation

Because the amplitude measurement accuracy of the detected signal by the DLIA is restricted by the frequency deviation Δ f , except for the noise in the measured signal itself, it is necessary to directly estimate the accurate frequency of the signal to generate corresponding reference signals. For a low SNR signal in Equation (1), assuming the sampling rate is f s , the discrete signal sequence is:
s [ n ] = A sin ( 2 π f f s n + ϕ ) + N ( n )
where n = 0 , 1 , N 1 ; N is the length of signal sequence. Then, the Discrete Fourier Transform (DFT) sequence can be calculated by the FFT algorithm:
S [ k ] = D F T { s [ n ] } = n = 0 N 1 s [ n ] e j 2 π n k N
where k [ 0 , N 1 ] . Ignoring the noise, in the spectrum of signal s [ n ] , the frequency of the actual signal corresponds to a spectral line with the largest amplitude whose index is represented as p k . However, the spectrum is discrete, the index p k represents a coarse frequency value, and the actual signal frequency can be calculated by:
f = ( p k + δ k ) f s N
where δ k [ 0.5 , 0.5 ] is the fractional residual part. The DFT discrete spectrum can only obtain the integer part p k . Therefore, there is a limited frequency resolution f s N , which is constrained by sampling rate f s and signal sequence length N. Due to the to-be-detected signal corresponding to a spectral line with the largest amplitude in the frequency domain, the frequency estimate issue can be transformed into a maximum optimization problem which is:
p ^ k = arg max 0 k N 2 1 | S [ k ] |
In Equation (14), k [ 0 , N 2 1 ] is a real number. Furthermore, according to the Euler formula and combining Equations (12) and (14), the frequency estimation task can be rewritten as:
f ^ = arg max f { | X ( f ) | } = arg max f { X R 2 ( f ) + X I 2 ( f ) }
X R ( f ) = 0 N 1 s [ n ] cos ( 2 π n f f s ) X I ( f ) = 0 N 1 s [ n ] sin ( 2 π n f f s )
where f [ ( p k 0.5 ) f s N , ( p k + 0.5 ) f s N ] . Therefore, when estimating the frequency of a signal as shown in Equation (11), the DFT is firstly processed on the signal sequence s [ n ] to obtain its spectrum. Then, the p k , which is the index of spectral line with largest amplitude, is found out. Finally, in the range f [ ( p k 0.5 ) f s N , ( p k + 0.5 ) f s N ] , a frequency f ^ that represents the signal frequency needs to be figured out to make Equation (15a) reach its maximum.
Assume that a measured signal s ( t ) = sin ( 2 π × 100 t ) , and the sampling rate and discrete signal sequence length are f s = 1000 and N = 4096 , respectively. The spectrum of this signal is shown in Figure 3a. The index of maximum spectral line is p k = 410 which represents the coarse frequency f c o a r s e = p k f s / N = 100.098 Hz. According to Equation (13), the real frequency is in the range [ 99.976 , 100.220 ] . Then, the trend of | X ( f ) | in Equation (15) in range [ 99.976 , 100.220 ] can be calculated and shown in Figure 3b.
From Figure 3b, it can be seen that in the region [ 99.976 , 100.220 ] , the | X ( f ) | has one maximum which represents the signal frequency.
In order to find the estimated frequency value f ^ which satisfies the maximum constraint of Equation (15), particle swarm optimization (PSO) algorithm is used. The PSO algorithm is an evolutionary computing technology, which describes the foraging behavior of birds and other social organisms and was proposed by Eberhart and Kennedy [29]. In the PSO algorithm, a population is constructed by M particles. Each particle i , ( i = 1 , 2 , , M ) has a position vector X i = [ x i , 1 , x i , 2 , , x i , L ] and a velocity vector V i = [ v i , 1 , v i , 2 , , v i , L ] , where L represents the dimension of solution space of a optimization problem. The position vector X i of each particle i is a potential solution in the problem–solution space. The iterative learning process is shown as:
V i t + 1 = ω V i t + c 1 × r a n d × ( p b e s t i X i t ) + c 2 × r a n d × ( g b e s t X i t )
X i t + 1 = X i t + V i t + 1
where t [ 1 , T ] is the number of iterations; T is the maximum number of iterations; r a n d is a random real number uniformly distributed between 0 and 1. p b e s t i = [ p b e s t i , 1 ,   p b e s t i , 2 ,   ,   p b e s t i , L ] is the personal best position of particle i from the initial moment to current iteration t. g b e s t = [ g b e s t 1 ,   g b e s t 2 ,   ,   g b e s t L ] is the best position of whole population until now. The self-cognition factor c 1 controls the strength that the particle i affected by its personal best position p b e s t i during the evolution. On the contrary, the group cognition factor c 2 controls the strength that particle i affected by the population best position g b e s t . ω is the inertial weight which represents the memory strength of the previous velocity and can balance the global search and local search ability [30]. The large inertial weight ω means the PSO has better global search ability and weaker local search ability. The smaller ω means the local search ability is better. Thus, in the initial stage of iteration, the PSO needs to have better global search ability (large ω ) to explore more solution space as possible and converge to the global optimum as soon as possible. When the iteration reaches the later stage, the particles gradually converge to the global optimum. At this time, PSO should have better local search ability (small ω ) and enable PSO to search accurately near the global optimum. Therefore, the linear decreasing inertial weight ω strategy is adopted:
ω = ω m a x t T ( ω m a x ω m i n )
where the ω m a x and ω m i n are 0.9 and 0.4 , separately. The inertial weight ω decreases gradually as the number of iterations t increases. The pseudo-code of the frequency estimation method is shown in Algorithm 1.
Algorithm 1 Pseudo-code of the PSO-based frequency estimation method.
Input:
     The signal sequence s [ n ] , sequence length N, and sampling rate f s ;
     Population size M of PSO, iteration times T, inertial weight ω , c 1 , and c 2 ;
Output:
     The signal frequency estimation value f ^ ;
1:
calculate the spectrum S [ k ] = D F T { s [ n ] }   ( k = 0 , 1 , 2 , , N 1 ) ;
2:
p ^ k = a r g m a x ( | S [ k ] | 2 ) ,   ( k = 0 , 1 , 2 , , N 2 1 ) ;
3:
calculate the search range [ f m i n , f m a x ] , where f m i n = ( p ^ k 0.5 ) f s / N , and f m a x = ( p ^ k + 0.5 ) f s / N ;
4:
randomly initialize M particles’ position uniformly distributed in range [ f m i n , f m a x ] ;
5:
randomly initialize M particles’ velocity;
6:
initialize gbest=zeros(1,1) and pbest=zeros(M,1)
7:
for t < T do
8:
    for each particle i do
9:
        calculate and store particle i’s fitness value by Equation (15);
10:
   end for
11:
   update gbest and pbest;
12:
   calcualte inertial weight ω i by Equation (17);
13:
   for each particle i do
14:
      update velocity V i using Equation (16a);
15:
      update position X i using Equation (16b);
16:
      check position vector X i in the serach range [ f m i n , f m a x ] ;
17:
   end for
18:
    t = t + 1 ;
19:
end for

3. Implementation

3.1. Multiple Frequencies Lock-In Amplifier

Supposing that there is a low SNR signal sequence s [ n ] containing K frequency components and noise w [ n ] :
s [ n ] = k = 1 K x k [ n ] + w [ n ] = k = 1 K a k sin ( 2 π f k f s n + ϕ k ) + w [ n ]
where a k , f k , and ϕ k are amplitude, frequency, and initial phase of k-th component; f s is the sampling rate. The number of frequency component K is prior information.
Assume that the spectrum of a multiple frequencies low SNR signal is shown in Figure 4. The different frequency component has various amplitudes. From Figure 4, the frequency component f m 1 with largest amplitude can be found whose index can be represented as p m 1 . According to the PSO-based frequency estimation method shown in Algorithm 1, the accurate frequency estimation value f ^ m 1 can be obtained.
Using the estimation frequency value f ^ m 1 , the quadrature reference signals can be generated:
r c [ n ] = B cos ( 2 π f ^ m 1 f s n )
r s [ n ] = B sin ( 2 π f ^ m 1 f s n )
At this time, through the orthogonal DLIA structure shown in Figure 1, the results of multiplying the measured signal and two quadrature reference signals (19a,b) are as follows:
R c [ n ] = a m 1 B 2 { sin ( ϕ m 1 ) + sin ( 4 π f ^ m 1 n f s + ϕ m 1 ) } + k = 0 , k m 1 K a k B 2 sin ( 2 π ( f k f ^ m 1 ) n f s + ϕ k ) + k = 0 , k m 1 K a k B 2 sin ( 2 π ( f k + f ^ m 1 ) n f s + ϕ k ) + w [ n ] r c [ n ]
R s [ n ] = a m 1 B 2 { cos ( ϕ m 1 ) cos ( 4 π f ^ m 1 n f s + ϕ m 1 ) } + k = 0 , k m 1 K a k B 2 cos ( 2 π ( f k f ^ m 1 ) n f s + ϕ k ) k = 0 , k m 1 K a k B 2 cos ( 2 π ( f k + f ^ m 1 ) n f s + ϕ k ) + w [ n ] r s [ n ]
The IAF filters out the noise and high-frequency interference terms. Then, the amplitude estimation a ^ m 1 and initial-phase estimation ϕ ^ m 1 can be obtained by Equation (6). After completing the parameters estimation of frequency component f m 1 , it can be removed from the original signal:
s [ n ] = s [ n ] a ^ m 1 sin ( 2 π f ^ m 1 n f s + ϕ ^ m 1 )
After that, DFT is processed on the new signal sequence s [ n ] , and the next spectral line p m 2 with largest amplitude can be found out. The estimation values of frequency f ^ m 2 , amplitude a ^ m 2 , and initial phase ϕ ^ m 2 are calculated by using the same frequency estimation method and DLIA structure. The flow of iterative low SNR signal parameters estimation method is shown in Algorithm 2.
Algorithm 2 Pseudo-code of the proposed low SNR multi-frequency signal parameters estimation method.
Input:
     The signal s ( t ) , sequence length N, and sampling rate f s ;
     Number of frequency components K;
     Integral average filter length L;
Output: 
     Frequency estimation value f ^ k , ( k = 1 , 2 , , K ) ;
     Amplitude estimation value a ^ k , ( k = 1 , 2 , , K ) ;
     Phase estimation value ϕ ^ k , ( k = 1 , 2 , , K ) ;
1:
for k < K do
2:
   calculate frequency value f ^ k using PSO-based frequency estimation method in Algorithm 1;
3:
   generate reference signals by Equation (19);
4:
   using orthogonal LIA and L-length IAF estimate amplitdue a ^ k and ϕ ^ k ;
5:
   remove k-th signal by Equation (22);
6:
end for

3.2. Integral Average Lowpass Filter Error Analysis

It can be seen from the previous analysis of Equation (10) that the frequency deviation Δ f affects the amplitude measurement accuracy. When there is a multiple frequencies low SNR signal (18), the frequency components f k ± f ^ m 1 as shown in Equations (20) and (21) should be regarded as frequency deviations for IAF.
The continuous form (4) of the IAF can be rewritten to the discrete form:
y [ n ] = 1 N k = 0 N x ( n k )
where the N is the integral length of the integral average filter. The transfer function of the integral average filter is:
H ( z ) = 1 N k = 0 N z k = 1 N 1 z N 1 z 1
The amplitude-frequency response characteristic [18] is:
H ( f ) = sin ( π N f f s ) N sin ( π f f s ) e j π ( N 1 ) f f s
When at low frequencies, the frequency response Equation (25) of IA can be approximately simplified:
H ( f ) = sin c ( N f f s ) e j π ( N 1 ) f f s
For large filter length N, the −3 dB frequency is about 0.443 f s / N which satisfies | H ( F ) | = 0.707 . Figure 5 represents the amplitude-frequency responses of different integral length N. It can be seen that the longer the filter length N, the faster roll-off in the low-frequency passband. Moreover, the narrow bandwidth can reduce the residual noise n ( t ) effectively in Equation (5) if the IAF has a large length N. In the high-frequency region, the IAF with a longer length N has greater attenuation capability. Because the frequency deviations f k ± f m 1 ^ caused by other frequency components are usually large, an integral average filter with a long length N can effectively filter out their interference. However, the frequency deviation Δ f between frequency component f m 1 and its corresponding reference signal f ^ m 1 is very small and in the passband of the integral average filter. Thus, the long filter length N has no significant improvement for amplitude estimation. That also indicates the frequency estimation method is necessary.

4. Experiment and Analysis

In order to validate this proposed method, the DLIA with multiple frequencies automatic frequency estimation ability is implemented in a PC, and different types of to-be-test signals are used.
The frequency deviation Δ f between the measured signal and reference is the key factor affecting the amplitude and phase measurement accuracy of the DLIA. Thus, the frequency estimation accuracy is verified first. Assuming the test is s [ n ] = sin ( 2 π f / f s n ) + w [ n ] , where the sampling frequency f s = 10 kSPS; and the length of the signal sequence is 4096. The w [ n ] is the Gaussian white noise which can be generated by Equation (27). In different SNR test conditions, the amplitude of the to-be-tested signal and the SNR are defined first. Then, according to Equation (27a), the required variance of the Gaussian white noise w [ n ] can be calculated. After that, the additive Gaussian white noise w [ n ] can be obtained by multiplying the Gaussian white noise w [ n ] with zero mean value and variance of 1 by the desired standard deviation D.
S N R = 10 log 10 ( A 2 2 D 2 )
w [ n ] = D × w [ n ]
The parameters of the PSO-based frequency estimation method are shown in Table 1.
In Figure 6, the signal which satisfies the Nyquist sampling theorem has been tested in different SNR situations. The largest relative frequency estimation error calculated by Equation (28) is 0.11 % when the SNR is −3 dB. In this condition, according to Equation (10), the relative error of amplitude estimation caused by frequency deviation between the reference and the measured signal is 0.06 % . Moreover, when the SNR of the measured signal is greater than −3 dB, the frequency estimation error is less than 0.1 % , which means the amplitude estimation error of the DLIA caused by frequency deviation can be neglected.
Frequency Relative error = | f e s t i m a t e f | f
From Figure 6, it can be seen that the frequency estimation error increased with the decrease in the SNR of the measured signal. The principle of the frequency estimation method is to find an optimal frequency which makes Equation (15) reach its maximum as shown in Figure 3b. The Gaussian white noise is uniformly distributed in the frequency domain. When the SNR of the measured signal is decreased, the optimum of the refined spectrum shown in Figure 3b deviates from the real optimal frequency points due to the noise energy at the specific frequency line.
After verifying the frequency estimating accuracy of the proposed method, the amplitude accuracy is subsequently tested. Assume that the to-be-tested signal is s [ n ] = A sin ( 2 π f / f s n ) + w [ n ] where A is the amplitude of the signal-needed estimate. Moreover, for the proposed method in this verification situation, the accuracy frequency value f of the measured signal is unknown, and it will be automatically estimated by the proposed method. The simulation results are shown in Figure 7.
As shown in Figure 7, the to-be-tested signal under different frequencies and different SNR conditions have been verified. In Figure 7a, the signal frequency f is 50 Hz, and the estimation value of the signal frequency calculated by the proposed method is 50.0085 Hz, which is very close to the setting value. Moreover, in the experiments, the varying measured signal amplitude does not affect the frequency estimation accuracy of the proposed method. When the SNR is −1 dB, the proposed automatic frequency estimation-based DLIA structure has the largest relative amplitude error which is 1.7%. With the SNR greater than 0 dB, for example, SNR = 10 dB and SNR = 15 dB, the relative amplitude error is less than 1%. When the SNR of the measured signal is decreased, the noise has more power in the view of both the time domain and the frequency domain. The frequency estimation error will increase as the increasement of noise power. According to Equation (10), the part of the amplitude measurement error caused by frequency deviation is increased when the SNR is low. The practical lowpass filter IAF used in this proposed method has the limited passband and attenuation of the stopband. Therefore, when the SNR of the measured signal is low, the energy of the residual noise filter by the IAF will be large. The amplitude measurement error is a combination of the amplitude error caused by the frequency estimation error and the residual noise, and it is increased when the SNR is low.
Then, in the test condition where the SNR is −1 dB, 0 dB, and 5 dB, respectively, the 100 independent frequency estimations and amplitude estimations of the proposed method are processed. This verification has two test signals of which the frequencies are 50 Hz and 100 Hz, respectively. The amplitude of the 50 Hz test signal is 1, and that of the 100 Hz test signal is 0.5. The distributions of the relative frequency measurement error are shown in Figure 8a–c. When the SNR is −1 dB, most of the relative frequency measurement error is less than 0.03%, especially in the test signal where the frequency is 100 Hz. With the SNR of the to-be-tested signal increasing, the relative frequency measurement errors are gradually concentrated at the range [0,0.01%]. Similar to the relative frequency measurement error, the relative errors of the amplitude measurement shown in Figure 8d–f decrease with the increasement of the SNR. Moreover, in all 100 independent tests, the relative errors of both frequency measurements and amplitude measurements are not larger than the errors shown in Figure 6 and Figure 7; that means this proposed method has good calculation stability in different SNR conditions.
The test results for the amplitude measurements of multiple frequency components under different frequency values and SNR are shown in Table 2. Due to the multiple frequency components, the local SNR [31] is used to describe the effect of noise on the useful signals, and the local SNR is:
L S N R i = 10 log 10 ( A i 2 2 D 2 )
where A i is the amplitude of the i-th frequency component, and D 2 is the variance of noise. In this multi-frequencies test, the variance D 2 of Gaussian white noise is 0.16 , according to Equation (29), and the local SNR of each signal frequency can be calculated as shown in Table 2.
The largest relative error of the amplitude estimation is 1.40% when the signal frequency and amplitude are 50 Hz and 0.5 , respectively, under the condition that the local SNR is −1.07 dB. The maximum relative amplitude error of 1.40% in the multi-frequency situation is not larger than the single-frequency situation; that means the number K of signal frequencies does not affect the amplitude estimation accuracy of the proposed method.
Compared with an FPGA-based method in the literature [25], this software implementation of the DLIA can estimate multiple signals’ amplitudes.Moreover, the method [25] can only track the fixed and known frequency of one signal, while this proposed method can estimate the varying frequencies of a measured signal automatically. Under the same SNR condition, the relative amplitude error of this proposed method is less than 1.7 % which is better than the 2 % of the FPGAbased method [25].

5. Conclusions

From the problem of frequency deviation between the measured signal and reference signal in the digital lock-in amplifier, an accurate DFT-based signal frequency estimation method is studied. This frequency estimation method can automatically measure the frequency value of the measured signal. Then, the reference signal will be generated according to this frequency estimation value without prior frequency information. Moreover, for the more general low SNR measured signal with multiple frequency components, an iterative software implementation DLIA method integrated with the frequency estimation method is designed. Under the different SNR conditions and the different number of frequency components, the relative errors of the amplitude estimation are less than 1.7 % . This proposed software DLIA method has relatively higher precision and is convenient to integrate with other signal processing systems in different applications.

Author Contributions

Conceptualization, K.C.; methodology, Y.W. and Y.C.; software, Y.W. and L.W.; formal analysis, H.W.; resources, H.W.; writing—original draft preparation, Y.W.; writing—review and editing, K.C.; validation H.W.; supervision, K.C.; project administration, K.C.; funding acquisition, Y.C. and K.C. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the National Key R&D Program of China (No. 2020YFB1711000).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Ma, T.; Xu, F.; Hu, J.; Song, D.; Cao, S. Double Gaussian Potential Stochastic Resonance Method and Its Application in Centrifugal Fan Blade Crack Detection. Chin. J. Phys. 2021, 74, 279–295. [Google Scholar] [CrossRef]
  2. Wang, Z.; He, G.; Du, W.; Zhou, J.; Han, X.; Wang, J.; He, H.; Guo, X.; Wang, J.; Kou, Y. Application of Parameter Optimized Variational Mode Decomposition Method in Fault Diagnosis of Gearbox. IEEE Access 2019, 7, 44871–44882. [Google Scholar] [CrossRef]
  3. Xiao, L.; Tang, J.; Zhang, X.; Xia, T. Weak Fault Detection in Rotating Machineries by Using Vibrational Resonance and Coupled Varying-Stable Nonlinear Systems. J. Sound Vib. 2020, 478, 115355. [Google Scholar] [CrossRef]
  4. Yao, J.; Liu, C.; Song, K.; Zhang, X.; Jiang, D. Fault Detection of Complex Planetary Gearbox Using Acoustic Signals. Measurement 2021, 178, 109428. [Google Scholar] [CrossRef]
  5. Fu, Q.; Wang, H. A Novel Deep Learning System with Data Augmentation for Machine Fault Diagnosis from Vibration Signals. Appl. Sci. 2020, 10, 5765. [Google Scholar] [CrossRef]
  6. Guo, S.; Wu, B.; Zhou, J.; Li, H.; Su, C.; Yuan, Y.; Xu, K. An Analog Circuit Fault Diagnosis Method Based on Circle Model and Extreme Learning Machine. Appl. Sci. 2020, 10, 2386. [Google Scholar] [CrossRef] [Green Version]
  7. Kong, X.; Yang, Z.; Luo, J.; Li, H.; Yang, X. Extraction of Reduced Fault Subspace Based on KDICA and Its Application in Fault Diagnosis. IEEE Trans. Instrum. Meas. 2022, 71, 1–12. [Google Scholar] [CrossRef]
  8. Zhang, D.; Ding, W.; Zhang, B.; Liu, C.; Han, J.; Doermann, D. Learning Modulation Filter Networks for Weak Signal Detection in Noise. Pattern Recognit. 2021, 109, 107590. [Google Scholar] [CrossRef]
  9. Liu, X.; Xiao, B.; Wang, C. Frequency Estimation of Chirp Signals Based on Fractional Fourier Transform Combined with Otsu’s Method. Optik 2021, 240, 166945. [Google Scholar] [CrossRef]
  10. Akilli, M.; Yilmaz, N. Study of Weak Periodic Signals in the EEG Signals and Their Relationship With Postsynaptic Potentials. IEEE Trans. Neural Syst. Rehabil. Eng. 2018, 26, 1918–1925. [Google Scholar] [CrossRef]
  11. Li, C.; Xu, X.; Ding, Y.; Yin, L.; Dou, B. Weak Photoacoustic Signal Detection Based on the Differential Duffing Oscillator. Int. J. Mod. Phys. B 2018, 32, 1850103. [Google Scholar] [CrossRef]
  12. Li, Y.; Su, Z.; Chen, K.; Zhang, W.; Du, M. Application of an EMG Interference Filtering Method to Dynamic ECGs Based on an Adaptive Wavelet-Wiener Filter and Adaptive Moving Average Filter. Biomed. Signal Process. Control 2022, 72, 103344. [Google Scholar] [CrossRef]
  13. Yan, S.; Sun, X.; Wang, Q.; Ren, Y.; Shi, W.; Wang, E. A Novel Double-Wing Chaotic System with Infinite Equilibria and Coexisting Rotating Attractors: Application to Weak Signal Detection. Phys. Scr. 2021, 96, 125216. [Google Scholar] [CrossRef]
  14. Xiao, L.; Zhang, X.; Lu, S.; Xia, T.; Xi, L. A Novel Weak-Fault Detection Technique for Rolling Element Bearing Based on Vibrational Resonance. J. Sound Vib. 2019, 438, 490–505. [Google Scholar] [CrossRef]
  15. Jiang, Y.; Li, H.; Rangaswamy, M. Deep Learning Denoising Based Line Spectral Estimation. IEEE Signal Process. Lett. 2019, 26, 1573–1577. [Google Scholar] [CrossRef]
  16. Uhl, D.; Bruder, L.; Stienkemeier, F. A Flexible and Scalable, Fully Software-Based Lock-in Amplifier for Nonlinear Spectroscopy. Rev. Sci. Instruments 2021, 92, 083101. [Google Scholar] [CrossRef]
  17. Lee, S.; Yim, S.H.; Kim, T.H.; Kim, Z.; Shim, K. Lock-in-Detection in 87Rb–129Xe/131Xe Atom Spin Gyroscopes. J. Phys. B At. Mol. Opt. Phys. 2020, 53, 035502. [Google Scholar] [CrossRef]
  18. Masciotti, J.M.; Lasker, J.M.; Hielscher, A.H. Digital Lock-In Detection for Discriminating Multiple Modulation Frequencies With High Accuracy and Computational Efficiency. IEEE Trans. Instrum. Meas. 2008, 57, 182–189. [Google Scholar] [CrossRef]
  19. Flater, E.E.; Mugdha, A.C.; Gupta, S.; Hudson, W.A.; Fahrenkamp, A.A.; Killgore, J.P.; Wilson, J.W. Error Estimation and Enhanced Stiffness Sensitivity in Contact Resonance Force Microscopy with a Multiple Arbitrary Frequency Lock-in Amplifier (MAFLIA). Meas. Sci. Technol. 2020, 31, 115009. [Google Scholar] [CrossRef]
  20. Stimpson, G.A.; Skilbeck, M.S.; Patel, R.L.; Green, B.L.; Morley, G.W. An Open-Source High-Frequency Lock-in Amplifier. Rev. Sci. Instruments 2019, 90, 094701. [Google Scholar] [CrossRef]
  21. Chen, X.; Wei, M.; Chen, K.; Li, S. Research on weak signal detection of integral average digital lock-in amplifier. Meas. Sci. Technol. 2021, 32, 105905. [Google Scholar] [CrossRef]
  22. Marcati Alexandrino Alves, G.; Domingues Mansano, R. Enhanced Frequency Resolution Two-Channel Two-Phase Microcontroller Lock-In Amplifier. IEEE Trans. Instrum. Meas. 2021, 70, 1–8. [Google Scholar] [CrossRef]
  23. Maya, P.; Calvo, B.; Sanz-Pascual, M.T.; Osorio, J. Low Cost Autonomous Lock-In Amplifier for Resistance/Capacitance Sensor Measurements. Electronics 2019, 8, 1413. [Google Scholar] [CrossRef] [Green Version]
  24. Xie, K.; Chen, L.; Huang, A.; Zhao, K.; Zhang, H. An Auxiliary Frequency Tracking System for General Purpose Lock-in Amplifiers. Meas. Sci. Technol. 2018, 29, 045010. [Google Scholar] [CrossRef]
  25. Zhang, C.; Liu, H.; Ge, J.; Dong, H. FPGA-Based Digital Lock-in Amplifier With High-Precision Automatic Frequency Tracking. IEEE Access 2020, 8, 123114–123122. [Google Scholar] [CrossRef]
  26. Nadgir, A.; Thurston, R.; Larsen, K.A.; Shivaram, N.; Brister, M.M.; Slaughter, D.S. SILIA: Software Implementation of a Multi-Channel, Multi-Frequency Lock-in Amplifier for Spectroscopy and Imaging Applications. Meas. Sci. Technol. 2021, 32, 125501. [Google Scholar] [CrossRef]
  27. Zhang, Y.; Jiang, P.; Cao, W.; Li, X.; Lai, J. High-Sensitivity Ethylene Gas Sensor Based on NDIR and Dual-Channel Lock-in Amplifier. Optik 2020, 223, 165630. [Google Scholar] [CrossRef]
  28. Wang, J.; Lui, J.; Wang, Z.; Liu, G. Accuracy Study for Lock-in Amplifiers in a Scanning near-Infrared Spectrometer. IET Sci. Meas. Technol. 2017, 11, 886–891. [Google Scholar] [CrossRef]
  29. Eberhart, R.; Kennedy, J. A New Optimizer Using Particle Swarm Theory. In Proceedings of the Sixth International Symposium on Micro Machine and Human Science, MHS’95, Nagoya, Japan, 4–6 October 1995; pp. 39–43. [Google Scholar] [CrossRef]
  30. Du, Y.; Xu, F. A Hybrid Multi-Step Probability Selection Particle Swarm Optimization with Dynamic Chaotic Inertial Weight and Acceleration Coefficients for Numerical Function Optimization. Symmetry 2020, 12, 922. [Google Scholar] [CrossRef]
  31. Gong, S.; Li, S.; Wang, H.; Ma, H.; Yu, T. Multi-Frequency Weak Signal Detection Based on Wavelet Transform and Parameter Selection of Bistable Stochastic Resonance Model. J. Vib. Eng. Technol. 2021, 9, 887–906. [Google Scholar] [CrossRef]
Figure 1. Structure of the orthogonal lock-in amplifier.
Figure 1. Structure of the orthogonal lock-in amplifier.
Applsci 12 06431 g001
Figure 2. Relative error of amplitude influenced by the frequency deviation: (a) initial phase of measured signal is zero and frequency deviation varies; (b) frequency deviation is fixed and initial phase of measured signal is non-zero.
Figure 2. Relative error of amplitude influenced by the frequency deviation: (a) initial phase of measured signal is zero and frequency deviation varies; (b) frequency deviation is fixed and initial phase of measured signal is non-zero.
Applsci 12 06431 g002
Figure 3. The spectrum of a simulation signal: (a) DFT result of the simulation signal; (b) refined spectrum | X ( f ) | in frequency range [ ( p k 0.5 ) f s N , ( p k + 0.5 ) f s N ] .
Figure 3. The spectrum of a simulation signal: (a) DFT result of the simulation signal; (b) refined spectrum | X ( f ) | in frequency range [ ( p k 0.5 ) f s N , ( p k + 0.5 ) f s N ] .
Applsci 12 06431 g003
Figure 4. Spectrum of a multi-frequency signal.
Figure 4. Spectrum of a multi-frequency signal.
Applsci 12 06431 g004
Figure 5. Amplitude-frequency response of IAF with different filter length N; (a) N = 100; (b) N = 500; (c) N = 1000; (d) N = 2000.
Figure 5. Amplitude-frequency response of IAF with different filter length N; (a) N = 100; (b) N = 500; (c) N = 1000; (d) N = 2000.
Applsci 12 06431 g005
Figure 6. Frequency estimation results under different SNR: (a) SNR = 10 dB, (b) SNR = 0 dB, (c) SNR = 1 dB, (d) SNR = −3 dB.
Figure 6. Frequency estimation results under different SNR: (a) SNR = 10 dB, (b) SNR = 0 dB, (c) SNR = 1 dB, (d) SNR = −3 dB.
Applsci 12 06431 g006
Figure 7. Amplitude estimation results under different SNR conditions and different signal frequencies: (a) signal frequency 50 Hz, (b) signal frequency 200 Hz, (c) signal frequency 500 Hz, (d) signal frequency 2000 Hz.
Figure 7. Amplitude estimation results under different SNR conditions and different signal frequencies: (a) signal frequency 50 Hz, (b) signal frequency 200 Hz, (c) signal frequency 500 Hz, (d) signal frequency 2000 Hz.
Applsci 12 06431 g007
Figure 8. The frequency and amplitude estimation result distributions of the proposed DLIA method: (a) frequency error distribution (SNR = −1 dB), (b) frequency error distribution (SNR = 0 dB), (c) frequency error distribution (SNR = 5 dB), (d) amplitude error distribution (SNR = −1 dB), (e) amplitude error distribution (SNR = 0 dB), (f) amplitude error distribution (SNR = 5 dB).
Figure 8. The frequency and amplitude estimation result distributions of the proposed DLIA method: (a) frequency error distribution (SNR = −1 dB), (b) frequency error distribution (SNR = 0 dB), (c) frequency error distribution (SNR = 5 dB), (d) amplitude error distribution (SNR = −1 dB), (e) amplitude error distribution (SNR = 0 dB), (f) amplitude error distribution (SNR = 5 dB).
Applsci 12 06431 g008
Table 1. The parameters setting of PSO-based frequency estimation method.
Table 1. The parameters setting of PSO-based frequency estimation method.
ParameterDescriptionValue
Nsignal sequence length4096
f s sampling rate10 kSPS
Mpopulation size20
Titeration times20
ω m a x max inertial weight0.9
ω m i n min inertial weight0.4
c 1 self-cognition factor0.6
c 2 group cognition factor0.8
Table 2. The frequencies and amplitudes estimation results of multi-frequency signal.
Table 2. The frequencies and amplitudes estimation results of multi-frequency signal.
Number
K
Local SNR
(dB)
Frequency EstimationAmplitude Estimation
Source
(Hz)
Calculation
(Hz)
Relative
Error (%)
SourceCalculationRelative
Error (%)
3−1.075049.9390.1220.50.5071.40
8.4710099.9870.0131.51.5130.87
10.97150150.0050.00333321.9920.40
4−1.075049.9740.0520.50.4951.00
1.85150149.9930.0046670.70.7050.71
8.47300299.9980.0006671.51.4930.47
10.97500500.0020.000421.9930.35
5−1.07120119.9880.010.50.5030.60
3.01240239.9850.006250.80.8030.38
6.53300300.0040.0013331.21.2030.25
10.971000999.9980.000222.0030.15
15.8322002199.980.0009093.53.4970.09
6−1.07300299.9960.0013330.50.4951.00
3.0112001200.0030.000250.80.7970.38
7.2324002400.0180.000751.31.2990.08
11.7931003099.9810.0006132.22.2010.05
14.7836003599.9830.0004723.13.0970.10
16.0742004200.0090.0002143.63.6040.11
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Wang, Y.; Cheng, Y.; Chen, K.; Wang, L.; Wang, H. A Software Digital Lock-In Amplifier Method with Automatic Frequency Estimation for Low SNR Multi-Frequency Signal. Appl. Sci. 2022, 12, 6431. https://doi.org/10.3390/app12136431

AMA Style

Wang Y, Cheng Y, Chen K, Wang L, Wang H. A Software Digital Lock-In Amplifier Method with Automatic Frequency Estimation for Low SNR Multi-Frequency Signal. Applied Sciences. 2022; 12(13):6431. https://doi.org/10.3390/app12136431

Chicago/Turabian Style

Wang, Yifan, Yuhua Cheng, Kai Chen, Li Wang, and Hongrong Wang. 2022. "A Software Digital Lock-In Amplifier Method with Automatic Frequency Estimation for Low SNR Multi-Frequency Signal" Applied Sciences 12, no. 13: 6431. https://doi.org/10.3390/app12136431

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop