2020 International Conference on Computer Intelligent Systems and Network Remote Control (CISNRC 2020) ISBN: 978-1-60595-683-1

Design of Digital Lock-in Based on

Meng Zhang, Minxiang Wei, Xinda Chen, Kai Chen

ABSTRACT

This paper introduced the design of a digital lock-in amplifier for weak crack detection. Due to the limitation of flicker noise and low pass filter performance, the error of the traditional lock-in amplifier in detecting weak will be large. In order to solve this problem, this paper designed an algorithm according to the source of noise. First, an orthogonal vector digital phase locked amplifier has been built. In addition, we have proposed and implemented a noise removal method based on Wiener filter, and optimized the anti-interference performance of the lock- in amplifier by sliding mean algorithm. The simulation results show that the proposed design can effectively extract the weak crack submerged in noise, optimize the performance of the traditional lock-in amplifier, improve the accuracy and reduce the noise interference.

KEYWORDS

Lock-in Amplifier, Weak Signal, Wiener Filtering, Sliding Median Filtering.

INTRODUCTION

Many components of construction machinery are subject to external conditions ______Meng Zhang, Minxiang Wei, Xinda Chen, Kai Chen College of Energy and Power Engineering, Nanjing University of Aeronautics and Astronautics, Nanjing 210016, China

99 such as high temperature, high pressure and sudden load in the process of work, which are prone to crack faults. Such cracks also occur in important structures like bridges. If the early crack fault is not detected and treated, the crack will continue to grow under the action of alternating load and so on, which will eventually lead to serious faults. Early crack fault detection can transform non-electric signals such as micro-displacement and micro-vibration into electric signals such as micro-current and low-voltage by sensors. Usually in this case, the signal is weak and mixed with a large number of noise signals, and the amplitude of external interference is much larger than the useful signal. The amplifier amplifies the measured signal and also amplifies the noise. Therefore, only by increasing the amplitude of the weak signal under the condition of effectively suppressing the noise can the useful signal be extracted. As shown in Figure 1, lock-in amplifier uses the principle of cross- correlation detection between the measured signal and the reference signal, which can effectively filter out the noise interference and complete the detection of crack signal. Literature [1] verified this detection method by using a lock-in amplifier for nondestructive detection of cast iron, and successfully extracted the signal of 31uV from the noise of 1000 times.

Test signal PSD1 LPF1 GDC1 I

90° phase Reference shift Signal Reference Channel

PSD2 LPF2 GDC2 Q

Figure 1. Principle of orthogonal vector-type lock-in amplifier.

Orthogonal vector lock-in amplifier is biphasic lock-in amplifier. There are two reference signals corresponding to two phase-sensitive phase-frequency detection units. Through signal processing of these two channels, the amplitude of the weak target component in the detected signal and the phase difference between the detected signal and the reference signal can be finally obtained. The realization of the lock-in amplification technique has a high requirement for the signal source to be detected. If there are large low-frequency noise and DC noise components in the signal acquired by the sensor, the result will have a large error due to the same frequency superposition. And the final detected amplitude is the sum of the original amplitude and noise signal amplitude in the target signal frequency band.

100 Literature [2] uses adaptive algorithm and particle swarm optimization (PSO) to search for the most matched and optimal particles to realize digital lock-in amplifier. This algorithm relies on a large amount of computation, and when Gabor particles are selected, the sampling point of the system is limited to 512 and the SNR is -5dB. In the research on the processing of weak signals by lock-in amplifier technology, literature3, based on the analysis of noise source, designed a single- power analog lock-in amplifier to restore signals doped with white noise, flicker noise and interference pollution. The results show that the amplifier can effectively recover the SNR information less than -24dB with an error of less than 6%. In this design, the error is mainly caused by the fact that the lock-in amplifier cannot completely eliminate the superposition of certain noises in the signal, such as flicker noise. Literature4 pointed out that by introducing a trans-impedance amplifier (TIA) and change the passive components in TIA to control the frequency range. The effects of flicker noise is reduced, because the TIA has structure of the . And its gain, stability, is a trade-off relationship between bandwidth and noise performance. This scheme needs for each target signal to be detected to select different input and feedback network to obtain the minimum noise gain.

In addition, the function of low-pass filter in orthogonal vector Lock-in amplifier is to filter out the AC component of Phase-Sensitive Detector (PSD) output signal, so a low-pass filter with low cut-off frequency and fast attenuation velocity is needed5. However, limited by the performance of the filter, the unfiltered AC signal will lead to inaccurate results. The above error is unacceptable for the precision detection technique of weak signal detection.

In order to overcome the above problems, the first stage of the orthogonal vector lock-in amplifier is designed to make the actual signal output of the sensor close to the expected signal as far as possible under the minimum mean square error criterion, so that the phase-sensitive detector can obtain a relatively pure signal source. The output signal is filtered by sliding mean method at the back stage of the phase-sensitive detector to eliminate the AC component, thus the accuracy of the detection results of the whole lock-in amplifier is improved.

SYSTEM MODELING BASED ON CORRELATION DETECTION PRINCIPLE

Cross-correlation detection is a method of spectrum migration, that is, a reference signal is designed through the known signal frequency, the target signal

101 frequency band is migrated to the noiseless band by mathematical calculation, and then the output signal can only contain the target signal information.

According to this principle, an orthogonal vector lock-in amplifier can be built. Its core component is the phase-sensitive detector, which is essentially a multiplier.

It is assumed that the input signal is the superposition of the target signal to be measured and the noise signal:

x(t) U sin(t )  n(t) x (1)

The reference signal shall be the same frequency signal of the target signal:

r(t) U sint R (2)

Therefore, after the phase-sensitive detector multiplies the two signals, it can be obtained as follows:

U U U U x(t)r(t)  x R cos  x R cos(2 t ) U n(t)sin t 2 2 0 R o (3)

After the signal is processed by a phase-sensitive detector, it enters into a low- pass filter. The low-pass filter filters out the noise components and the components whose frequency is two times of the reference signal frequency, therefore:

U U u  x R cos x 2 (4)

Because the amplitude of the reference signal is known, a DC signal containing the amplitude and phase information of the weak crack signal can be obtained.

102 In this design, the phase difference between the two reference signals is 90

u x u x degrees. The DC signals output by the two PSDs are 1 and 2 , based on equation (4). Then the amplitude and phase information of the target signal can be extracted as:

2 2 2 U x  ux  ux U 1 2 R (5)

ux   arctan( 1 ) ux 2 (6)

In engineering applications, the introduction of noise will have a great impact on the results under certain circumstances. For example, the flicker noise, which can be widely found in passive devices, also known as 1/f noise, is characterized by the inverse ratio between noise power and frequency6, so it has a great influence in low frequency band. In practical application, the amplitude detected by lock-in amplifier is the sum of the amplitude of target signal and the amplitude of flicker noise at this frequency. In addition, the low-pass filter cannot filter out all AC signals in practice, so the output signals of two phase-sensitive detectors are actually the expected DC signals and the noise of AC components.

DESIGN OF DIGITAL LOCK-IN AMPLIFIER

Overall Design

Based on the analysis in chapter 2, the simulation platform of orthogonal vector digital lock-in amplifier has been built, as shown in Figure 2.

103

Figure 2. Simulation platform of orthogonal vector Lock-in amplifier.

As shown in Figure 2, in the established simulation platform, wiener filter processes the input signals of the whole system so that a relatively pure signal source can be obtained from the lock-in amplifier for crack detection and target signal to be measured. The reference signal sent by the two reference signal sources with a phase difference of 90 degrees is processed into a DC signal containing the original signal information in the phase-sensitive detector and then the noise is reduced in the low-pass filter and Anti-AC module. Finally, the amplitude and phase information of the target signal to be measured can be obtained through mathematical operation.

The First Stage Channel Algorithm Based on Wiener Filtering

In order to reduce the error of the result, the orthogonal vector lock-in amplifier needs to obtain the purest detection signal in low frequency band. Assuming that the input of the linear filter is the sum of the target signal and noise, both of which are generalized stationary processes and their second-order statistical characteristics are known, the parameters of the optimal linear filter can be obtained according to the minimum mean square error criterion (the minimum mean square value of the difference between the output signal of the filter and the expected signal)[7].

Assuming that the input of Wiener filter is random signal with noise, the difference between the expected output and the actual output is error, the smaller the mean square error is, the better the noise filtering effect will be. [8-10] The unit of the linear system is assumed to be h(n), A signal detected by a

104 sensor x(n) is a superposition of the target signal s(n) and noise signal w(n). Therefore, the output of the linear system is:

 y(n)  x(n)*h(n)  h(m)x(n  m) m (7)

Let the mean square error between the observed value and the estimated value in the system be minimized, then the minimum mean square error criterion is obtained as:

 2 2 E[e (n)]  E[(s(n)  s(n)) ] (8)

Based on causal sequence, h(n)=0, n<0, the Wiener - Hoff equation can be solved under this criterion:

  y(n)  s(n)  h(m)x(n  m) m0 (9)

 E[e2 (n)]  E[(s(n)  h(m)x(n  m))2 ] m0 (10)

When m = 0, 1, 2..., the best h(hopt(n)) under the above criteria can be obtained through the Wiener-Hoff equation as:

 E[s(n)x(n  j)]  hopt (m)E[x(n  m))x(n  j)] j  0 m0 (11)

 Rxs( j)  hopt (m)Rxx( j  m) j  0 m0 (12)

105 In order to minimize the mean square error, the key is to find the impulse response. If the Wiener-Hoff equation is satisfied, the wiener filter can be optimized. According to the Wiener-Hoff equation, the impulse response of the optimal Wiener filter is determined by the input autocorrelation function and the cross-correlation function between the input and the desired output. N linear equations are obtained, which can be written in matrix form:

 Rxx(0) Rxx(1) ... Rxx(N 1) h(0)   Rxs(0)      R (1) R (0) ... R (N  2)  h(1)  R (1)  xx xx xx     xs   ......  ...   ...       R (N 1) R (N  2) ... R (0) h(N 1) R (N 1)  xx xx xx    xs  (13)

Where

R H  R xx xs (14)

In the formula, H is the response to be solved,

   2   E[e (n)] min  Rss (0)  2 hopt (m)Rxs (m)   hopt (m) hopt (r)Rxx (m  r) m0 r0  r0  (15)

Therefore

 2 E[e (n)] min  Rss (0)  hopt (m)Rxs (m) m0 (16)

And the noise added to the signal is a random number. Therefore, the minimum mean square deviation is:

106  2 E[e (n)] min  Rss (0)  hopt (m)Rss (m) m0 (17)

Based on the above derivation, this paper designs the first stage filter of orthogonal vector lock-in amplifier, and uses the filtered signal to detect cracks, and selects the FIR time-domain filter11. The input signal x(n) is generalized stationary stochastic process, it is assumed that the noise introduced at this time includes flickering noise and harmonic noise, x(n) is a working sinusoidal signal with an amplitude of 130V and a frequency of 60Hz. Then the process autocorrelation function is Rxx(m)=Acosωn. The optimal solution hopt can be obtained from the Wiener-Hoff equation.

The process is implemented in Matlab, and the results are shown in Figure 3:

Figure 3. Filtering of low-frequency noise in the front stage.

It can be seen that the algorithm effectively filters the signal doped with flicker noise and harmonic noise, provides a relatively high quality signal source for the phase-sensitive detector, and reduces the low-frequency noise of the signal.

107 Last Stage Channel Algorithm Based on Sliding Mean Filtering

A low pass filter is needed to filter out the AC component of the phase-sensitive detector. The AC component is derived from the DC component of the preceding noise multiplied by the AC component of the reference signal, so this part of the error varies with the magnitude of the DC component of the preceding noise. In fact, the filter cannot completely remove the AC component of this part, which will cause the numerical error of DC signal. Therefore, the signal after low-pass filtering is windowed sampling. Every time the window moves forward, the first number is removed from the numerical queue in the window, and a new number is obtained at the last position. After completing a calculation, the window moves forward. Thus, the whole signal is smooth.

T Assume that the sliding mean of window period is 0 , an AC component in the input DC signal is:

2 f (t)  cos( t) T (18)

T  kT  R 0 (19)

After treatment, the amplitude of the AC component is:

R 2 2 2 T T A  cos( t)dt  sin( 0  k ) T  T T T 0 0 0 (20)

This process is implemented in Matlab. Based on 5V DC signal, gaussian noise signal with variance of 1V and AC component with amplitude of 1V, the results can be shown in Figure 4:

108

Figure 4. Filtering of AC components.

The results show that the algorithm can effectively smooth the output components of the low-pass filter and obtain a relatively stable DC signal, so the detection accuracy of the lock-in amplifier can be improved.

So far, the design of orthogonal vector digital lock-in amplifier is completed.

SIMULATION AND RESULTS

In the simulation experiment, the target signal amplitude was set as 1μV, frequency was set as 30Hz, phase was set as 0.2π, noise was gaussian noise with variance of 1V, flicker noise and resonance noise. The output of the last stage of the amplitude and phase detection channel is selected as the observation object. It can be seen from Figure 5 that the lock-in amplifier in this design scheme reaches stable output after about 0.3 seconds. After the final stability, the phase value and amplitude of the lock-in amplifier were 0.6345 and 0.9941μV, and the errors were all less than 1%.

109

Figure 5. Signal detection using a lock-in amplifier.

After removing the Wiener filter module and Anti-AC module, it can be seen from Figure 6 that the lock-in amplifier in this design scheme is difficult to obtain stable output. After 0.3 seconds, the maximum amplitude channel error reached about 25% and the maximum phase channel error reached about 28%.

Figure 6. Signal detection with lock-in amplifier after removing the noise filter module.

110 Therefore, the lock-in amplifier designed in this paper can improve the detection ability of weak signals.

CONCLUSION

In this paper, an orthogonal vector phase locked amplifier for weak signal processing is designed and simulated. The results show that the algorithm can effectively solve the influence of low-frequency superposition noise and phase- sensitive detector output AC component, and improve the detection precision and anti-noise ability of weak signal. At the same time, the results show that the performance of the lock-in amplifier can be improved by the minimum mean square error criterion.

ACKNOWLEDGMENTS

Corresponding author: Meng Zhang. This work was financially supported by China's National Key Research and Development Program "Weak Electrical Signal Precision Detection and High-speed Data Processing Technology (No. 2018YFB2003300)".

REFERENCES

1. F. Munoz, J. V. Miro, G. Dissanayake, N. Ulapane and L. Nguyen, "Design of a lock-in amplifier integrated with a coil system for eddy-current non-destructive inspection," 2017 12th IEEE Conference on Industrial Electronics and Applications (ICIEA), Siem Reap, 2017, pp. 1948-1953, doi: 10.1109/ICIEA.2017.8283157.

2. S. Jiang, T. Zhang, S. Dai, Y. Li and Q. Gao, "Weak signal detection method of adaptive digital lock-in amplifier based on particle swarm optimization algorithm," 2009 9th International Conference on Electronic Measurement & Instruments, Beijing, 2009, pp. 2-436-2-441, doi: 10.1109/ICEMI.2009.5274545.

111 3. J. Aguirre, N. Medrano, B. Calvo, S. Celma and C. Azcona, "An analog lock-in amplifier for embedded sensor electronic interfaces," 2011 20th European Conference on Circuit Theory and Design (ECCTD), Linkoping, 2011, pp. 425-428, doi: 10.1109/ECCTD.2011.6043377.

4. Ji-Hoon Kim, Su-Jin Jeon, Myung-Gi Ji, Jun-Hee Park, Young-Wan Choi, "Analysis on of trans-impedance amplifier (TIA) for signal-to-noise ratio (SNR) enhancement in optical signal detection system using lock-in amplifier (LIA)," Smart Photonic and Optoelectronic Integrated Circuits XIX,San Francisco, SPIE, 2017, doi: 10.1117/12.2250731.

5. J. Leis, P. Martin and D. Buttsworth, "Simplified digital lock-in amplifier algorithm," in Electronics Letters, vol. 48, no. 5, pp. 259-261, 1 March 2012, doi: 10.1049/el.2012.0193.

6. A. A. b. Zali, A. Z. b. Sha'ameri, Y. Y. Mohammed, G. b. Hussin and Chee Yen Mei, "Enhancement of power measurement by decimation in 1/f noise," 2015 IEEE Student Conference on Research and Development (SCOReD), Kuala Lumpur, 2015, pp. 610-614, doi: 10.1109/SCORED.2015.7449410.

7. P. E. Wellstead, G. R. Wagner and J. R. Caldas-Pinto, "Two-dimensional adaptive prediction, smoothing and filtering," in IEE Proceedings F - Communications, Radar and Signal Processing, vol. 134, no. 3, pp. 253-267, June 1987, doi: 10.1049/ip-f-1.1987.0053.

8. B. Sharma and R. J. Suji, "ECG denoising using weiner filter and adaptive least mean square algorithm," 2016 IEEE International Conference on Recent Trends in Electronics, Information & Communication Technology (RTEICT), Bangalore, 2016, pp. 53-57, doi: 10.1109/RTEICT.2016.7807781.

9. A. Badarudeen, G. Student and K. Gopakumar, "Wideband spectrum sensing using Multi Stage Weiner Filter," 2016 IEEE 7th Annual Ubiquitous Computing, Electronics & Mobile Communication Conference (UEMCON), New York, NY, 2016, pp. 1-5, doi: 10.1109/UEMCON.2016.7777871.

10. L. Alhafadhi, J. Asumadu and A. Alsafi, "Total harmonics reduction using adaptive, Weiner, and Kalman filters," 2017 IEEE 7th Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas, NV, 2017, pp. 1-8, doi: 10.1109/CCWC.2017.7868353.

11. M. Aktas and T. E. Tuncer, "Ring based FIR-IIR best delay LS inverse filters," Proceedings of the IEEE 12th Signal Processing and Communications Applications Conference, 2004., Kusadasi, Turkey, 2004, pp. 208-211, doi: 10.1109/SIU.2004.1338295.

112