Skip to main content

A low computation detection method of signal nonlinear distortion based on digital quadrature detection principle

Abstract

This paper presents a digital low computation detection method for signal nonlinear distortion. After presetting ADC sampling rate and completing data sampling, the low sampling rate data extracted from the sampling data complete the autocorrelation analysis to correct and calculate the accurate fundamental frequency. According to the relationship between the fundamental frequency and the sampling rate, the complete periodic segment data of the signal cutting out from the sampling data carry out the digital quadrature detection operation to obtain the value of each harmonic component and nonlinear distortion. Experiments show that the calculation of this method is less than that of FFT spectrum analysis method when measuring the THD lower than 15 order. When calculating the 15-order THD at 1024 points, the calculation time is reduced by 44.26%. Moreover, the digital quadrature detection method has high measurement accuracy with less than 0.6% error of detecting 5-order THD.

1 Introduction

Nonlinear distortion refers to the distortion caused by the new frequency component superimposed on the output signal after an AC signal passes through a nonlinear system. These new frequency components are mainly the harmonic components of the original input signal, so they are also called nonlinear harmonic distortion. Harmonic distortion widely exists in power grid, battery technology, instrumentation detection, nonlinear materials, and other technical fields, which is commonly used to weigh the quality and stability of related technologies or materials. Therefore, the accurate detection of nonlinear harmonic distortion is particularly important [1,2,3].

Harmonic analysis is one of the main methods to detect the nonlinear harmonic distortion of signal. This method mainly uses DFT or FFT to separate each order of harmonics, extract harmonic components, and calculate harmonic distortion [4]. In actual measurement, the measured signal is usually asynchronous or aperiodic sampling, so it is difficult to accurately match the harmonic peak frequency with the sampling frequency, which results in fence effect and loss of spectrum information. The commonly used improvement method is to increase the sampling rate to reduce the interval between the harmonic frequency of the measured signal and the sampling frequency. The Nuttall window interpolation FFT algorithm can make harmonic frequency and component detection more accurate [5]. DFT or FFT operation must add window function. Multiplication in time domain and convolution in frequency domain will cause spectrum leakage distortion of the signal, and many side lobes next to the main spectral line will cause interference between spectral lines. The common solution is to expand the width of time domain and narrow the frequency domain, which can reduce energy leakage and improve the accuracy of harmonic detection.

Increasing the sampling rate, expanding the time domain width, windowing interpolation, and some other methods will lead to a significant increase in the amount of sampling data and computation, which have higher computational power requirements for the operation processor. Meanwhile, that is also the main reason that many low performance processors cannot widely use DFT and FFT. In the relevant experiments and research, we try to accurately measure the fundamental frequency of harmonic signal to intercept the sampled signal completely and then perform FFT operation, which can effectively avoid the detection error caused by fence effect and spectrum leakage. Firstly, we chose the zero-crossing detection method to detect the fundamental frequency of the harmonic signal. However, we find that different levels of harmonic components of the harmonic signal will cause uncertainty in the number of zero-crossing points in the signal cycle, so that the detected frequency may be an integral multiple of the fundamental frequency. Since the harmonic signal is a periodic signal, we decided to quickly estimate the fundamental frequency of the sampled signal by using autocorrelation analysis to resample the signal, which has certain errors. By correcting the zero-crossing detection frequency with the fundamental frequency estimated by autocorrelation, the fundamental frequency of harmonic signal under different conditions can be accurately obtained. The higher harmonic components of most nonlinear distortion detection signals can be ignored that result in a lot of meaningless calculation work when using DFT or FFT. Therefore, inspired by the basic theory of DFT, we choose the digital orthogonal detection method to calculate only the necessary low-order harmonics, instead of meaningless high-order harmonic analysis, which greatly improves the calculation efficiency of the system and ensures the detection accuracy of nonlinear distortion under the same conditions.

2 Method and simulation

2.1 Autocorrelation frequency analysis correction

Zero-crossing detection is ordinarily used to measure the frequency of periodic signals, which converts the measured signals into pulse signals that can be directly read by the processor through the threshold set by the circuit. MCU counts the edge of the pulse signal as \(n\), and accurately time the start to the end points of \(n\) edges as \(t\) in the meantime; then, the frequency of the signal is \(f_{0} = \left( {n - 1} \right)/2t\). However, due to the high-order harmonic signal component of the measured signal, phase difference, or voltage offset of the measured signal, the actual number of zero crossings of the signal is more than that of the fundamental signal and is usually an integer multiple relationship. As shown in Fig. 1, there are six zero crossings in a fundamental wave period, and the frequency of zero crossing detection is three times that of the fundamental wave. In the process of zero crossing detection, this frequency multiple will be different due to the influence of signal voltage offset or harmonic component value and phase.

Fig. 1
figure 1

Signal with the number of zeros greater than the fundamental wave

The frequency obtained by zero crossing detection must be greater than or equal to the fundamental frequency of the measured signal, so the detection system can preset the sampling rate as \(f_{s} = mf_{0} \left( {m \ge 32} \right)\) and the sampling time width as \(t_{{\text{s}}} = N{/}f_{{\text{s}}} \left( {N \ge 4m} \right)\), where \(m\) is the number of periodic sampling points and \(N\) is the total number of sampling points. The sampled data are stored in \({\text{ADC}}\_{\text{data}}\left[ N \right]\) and used for autocorrelation frequency analysis and nonlinear distortion calculation.

The autocorrelation frequency analysis adopts the convolution algorithm, which needs to resample \(N^{\prime }\) points data from the \(N\) points sampling data for calculation and ensure the resampling frequency \(f_{{{\text{ex}}}}\) not less than \(4f_{0}\); resampling shall not be less than 3 cycles. The data extraction method is shown in Eq. (1).

$${\text{extr}}\left[ i \right] = {\text{ADC}}\_{\text{data}}\left[ {i \cdot \frac{{f_{s} }}{{f_{ex} }}} \right] ,i = 0,1,2 \ldots ,i \cdot \frac{{f_{{\text{s}}} }}{{f_{{{\text{ex}}}} }} \le N .$$
(1)

Literature [6, 7] proposes that in frequency analysis, the convolution object is discrete data of finite length, and the estimated frequency can be obtained by autocorrelation method in time domain. The calculation formula of autocorrelation convolution is:

$$\mathop \smallint \limits_{ - \infty }^{ + \infty } f\left( u \right) \cdot f\left( {u + x} \right){\text{d}}u.$$
(2)

By changing the position of the autocorrelation function cyclically, the result after convolution with the original signal is used as the basis for determining the similarity between the autocorrelation function and the original signal. The discrete convolution calculation of the estimated frequency autocorrelation is shown in Eq. (3), where \(n\) is the data length and \({\text{pos}}\) is the moving position of the autocorrelation function.

$${\text{conv}}\left[ {{\text{pos}}} \right] = {{\left\{ {\mathop \sum \limits_{i = 0}^{{i < n - {\text{pos}}}} {\text{extr}}\left[ i \right] \cdot {\text{extr}}\left[ {i + {\text{pos}}} \right] + \mathop \sum \limits_{{i = n - {\text{pos}}}}^{i < n} {\text{extr}}\left[ i \right] \cdot {\text{extr}}\left[ {i - \left( {n - {\text{pos}}} \right)} \right]} \right\}} \mathord{\left/ {\vphantom {{\left\{ {\mathop \sum \limits_{i = 0}^{{i < n - {\text{pos}}}} {\text{extr}}\left[ i \right] \cdot {\text{extr}}\left[ {i + {\text{pos}}} \right] + \mathop \sum \limits_{{i = n - {\text{pos}}}}^{i < n} {\text{extr}}\left[ i \right] \cdot {\text{extr}}\left[ {i - \left( {n - {\text{pos}}} \right)} \right]} \right\}} {n,{\text{pos}} = 0,1, \ldots ,n - 1}}} \right. \kern-0pt} {n,{\text{pos}} = 0,1, \ldots ,n - 1}}$$
(3)

The autocorrelation convolution result is stored in the array \({\text{conv}}\left[ n \right]\), where the data with the maximum peak value and the footmark closest to 0 are the starting point of the autocorrelation function signal where the original signal has moved for a complete period, and the time of the starting point is the estimated fundamental wave period of the original signal. The simulation results are shown in Fig. 2. Finally, the measured frequency is:

$$f_{{{\text{co}}}} = {\text{round}}\left( {f_{0} {\text{/round}}\left( {f_{0} {/}f_{{{\text{es}}}} } \right)} \right) .$$
(4)
Fig. 2
figure 2

Autocorrelation frequency estimation results

In Fig. 2, the fundamental frequency of the signal estimated by the autocorrelation convolution method in the simulation is \(f_{{{\text{es}}}} = {\text{round}}\left( {1/0.002214s} \right) = 444.44\;{\text{Hz}}\). There are 4 zeros in each cycle. For example, the zero crossing detection frequency is \(2702\;{\text{Hz}}\), and the corrected signal frequency is \(f_{{{\text{co}}}} = 450.33\;{\text{Hz}}\).

2.2 Digital quadrature detection analysis method

In the signal processing of the electronic system, the received real signal can be expressed as

$$r\left( t \right) = {\text{Re}} \left\{ {S\left( t \right)e^{{i\left[ {\omega_{0} t + \varphi \left( t \right)} \right]}} } \right\} = {\text{Re}} \left\{ {\tilde{S}\left( t \right)e^{{j\omega_{0} t}} } \right\}.$$

In the equation, \(\tilde{S}\left( t \right)\) is the complex envelope of the signal, which can be expressed as

$$\tilde{S}\left( t \right) = S\left( t \right)\cos \varphi \left( t \right) + jS\left( t \right)\sin \varphi \left( t \right) = I\left( t \right) + jQ\left( t \right).$$

That is, the complex envelope of the signal is composed of the in-phase component \(I\left( t \right)\) and the quadrature component \(Q\left( t \right)\). The analog quadrature detection method is to obtain the in-phase and quadrature components of the signal after mixing and filtering of two analog quadrature local oscillator signals [8, 9].

In this study, each harmonic signal of the measured signal is treated as a complex signal to complete the quadrature detection calculation. After filtering, the in-phase and quadrature components are analyzed to calculate the amplitude of the harmonic signal as shown in Eq. (5).

$$\left\{ {\begin{array}{*{20}c} {I = \frac{{\mathop \smallint \nolimits_{0}^{{\frac{2n\pi }{\omega }}} F\left( t \right) \cdot \cos \omega t {\text{d}}t}}{{2n\pi {/}\omega }}} \\ {Q = \frac{{\mathop \smallint \nolimits_{0}^{{\frac{2n\pi }{\omega }}} F\left( t \right) \cdot \sin \omega t {\text{d}}t}}{{2n\pi {/}\omega }}} \\ \end{array} } \right.$$
(5)

In the method, the harmonic signal with different frequency from the detection signal in the original signal will be integrated and filtered, and the in-phase component and the quadrature component with the same frequency as the detection signal will be left. Suppose that the harmonic component signal of a certain frequency in the original signal is \(h\left( t \right) = A\sin \left( {\omega t + \varphi } \right)\), the reference sine function is \(s\left( t \right) = \sin \omega t\), the reference cosine function is \(c\left( t \right) = \cos \omega t\). The derivation is shown in Eqs. (67).

$$\begin{aligned} I & = \frac{{\mathop \smallint \nolimits_{0}^{{\frac{2n\pi }{\omega }}} A\sin \left( {\omega t + \varphi } \right) \cdot \cos \omega t {\text{d}}t}}{2n\pi /\omega } \cdot 2 \\ & = \frac{2A}{{2n\pi /\omega }} \cdot \mathop \smallint \limits_{0}^{{\frac{2n\pi }{\omega }}} \left( {\sin \omega t \cdot \cos \varphi + \cos \omega t \cdot \sin \varphi } \right) \cdot \cos \omega t {\text{d}}t \\ & = \frac{2A}{{2n\pi /\omega }} \cdot \left( {\mathop \smallint \limits_{0}^{{\frac{2n\pi }{\omega }}} \cos \varphi \cdot \sin \omega t \cdot \cos \omega t {\text{d}}t + \mathop \smallint \limits_{0}^{{\frac{2n\pi }{\omega }}} \sin \varphi \cdot \cos^{2} \omega t {\text{d}}t} \right) \\ & = \frac{2A}{{2n\pi /\omega }} \cdot \left( {\mathop \smallint \limits_{0}^{{\frac{2n\pi }{\omega }}} \cos \varphi \cdot \frac{\sin 2\omega t}{2} {\text{d}}t + \mathop \smallint \limits_{0}^{{\frac{2n\pi }{\omega }}} \sin \varphi \cdot \frac{1 + \cos 2\omega t}{2} {\text{d}}t } \right) \\ & = \frac{2A}{{2n\pi /\omega }} \cdot \left( {\left. { - \frac{\cos \varphi }{2} \cdot \frac{\cos 2\omega t}{{2\omega }}} \right|_{0}^{{\frac{2n\pi }{\omega }}} + \left. {\frac{\sin \varphi }{2} \cdot \frac{2\omega t + \sin 2\omega t}{{2\omega }}} \right|_{0}^{{\frac{2n\pi }{\omega }}} } \right) \\ & = \frac{2A}{{2n\pi /\omega }} \cdot \frac{\sin \varphi \cdot 2n\pi }{{2\omega }} = A\sin \varphi \\ \end{aligned}$$
(6)
$$\begin{aligned} Q & = \frac{{\mathop \smallint \nolimits_{0}^{{\frac{2n\pi }{\omega }}} A\sin \left( {\omega t + \varphi } \right) \cdot \sin \omega t {\text{d}}t}}{2n\pi /\omega } \times 2 \\ & = \frac{2A}{{2n\pi {/}\omega }} \cdot \mathop \smallint \limits_{0}^{{\frac{2n\pi }{\omega }}} \left( {\sin \omega t \cdot \cos \varphi + \cos \omega t \cdot \sin \varphi } \right) \cdot \sin \omega t {\text{d}}t \\ & = \frac{2A}{{2n\pi {/}\omega }} \cdot \left( {\mathop \smallint \limits_{0}^{{\frac{2n\pi }{\omega }}} \cos \varphi \cdot \sin^{2} \omega t {\text{d}}t + \mathop \smallint \limits_{0}^{{\frac{2n\pi }{\omega }}} \sin \varphi \cdot \sin \omega t \cdot \cos \omega t {\text{d}}t} \right) \\ & = \frac{2A}{{2n\pi {/}\omega }} \cdot \left( {\mathop \smallint \limits_{0}^{{\frac{2n\pi }{\omega }}} \frac{\cos \varphi }{2} \cdot \frac{1 - \cos 2\omega t}{{2\omega }} + \mathop \smallint \limits_{0}^{{\frac{2n\pi }{\omega }}} \frac{\sin \varphi }{2} \cdot \sin 2\omega t {\text{d}}t} \right) \\ & = \frac{2A}{{2n\pi {/}\omega }} \cdot \left( {\left. {\frac{\cos \varphi }{2} \cdot \frac{2\omega t - \sin 2\omega t}{{2\omega }}} \right|_{0}^{{\frac{2n\pi }{\omega }}} - \left. {\frac{\sin \varphi }{2} \cdot \frac{\cos 2\omega t}{{2\omega }}} \right|_{0}^{{\frac{2n\pi }{\omega }}} } \right) \\ & = \frac{2A}{{2n\pi {/}\omega }} \cdot \frac{\cos \varphi \cdot 2n\pi }{{2\omega }} = A\cos \varphi \\ \end{aligned}$$
(7)

The amplitude calculation of the corresponding frequency harmonic signal is not affected by the signal sampling starting point or phase, and the result is

$$\sqrt {I^{2} + Q^{2} } = \sqrt {A^{2} \sin^{2} \varphi + A^{2} \cos^{2} \varphi } = A .$$

Digital quadrature detection is to perform quadrature detection and convolution filtering on the discrete signal of ADC sampling. First, the whole period signal can be intercepted from the sampling data \({\text{ADC}}\_{\text{data}}\left[ N \right]\) according to the sampling rate \(f_{s}\) and the calculated fundamental frequency \(f_{{{\text{me}}}}\) of the signal, and the intercepting length is \(L = f_{{\text{s}}} {/}f_{{{\text{me}}}}\).

And then extract the data corresponding to the length of the sampled signal from the pre-stored reference function according to the whole period length \(L\) to calculate the h-th harmonic component, as shown in Eq. (8). The reference sine function is pre-stored as \({\text{Sin}} \_{\text{dat}}\left[ M \right]\); the reference cosine function is pre-stored as \({\text{Cos}} \_{\text{dat}}\left[ M \right]\).

$$\left\{ {\begin{array}{*{20}c} {I_{{\text{h}}} = \left( {\mathop \sum \limits_{i = 0}^{i < L} {\text{ADC}}\_{\text{data}}\left[ i \right] \cdot {\text{Cos}} \_{\text{dat}}\left[ {\left( {i\% \left( \frac{L}{h} \right)} \right) \cdot M \cdot h{/}L} \right]} \right) \cdot 2{/}L} \\ {Q_{{\text{h}}} = \left( {\mathop \sum \limits_{i = 0}^{i < L} ADC\_{\text{data}}\left[ i \right] \cdot {\text{Sin}} \_{\text{dat}}\left[ {\left( {i\% \left( \frac{L}{h} \right)} \right) \cdot M \cdot h{/}L} \right]} \right) \cdot 2{/}L} \\ {{\text{Amp}}_{{\text{h}}} = \sqrt {I_{{\text{h}}}^{2} + Q_{{\text{h}}}^{2} } } \\ \end{array} } \right.$$
(8)

where h is the harmonic order; \({\text{Amp}}_{{\text{h}}}\) is the harmonic amplitude. The simulation results of the harmonic components lower than the 9th order calculated by the digital quadrature detection method are shown in Fig. 3.

Fig. 3
figure 3

Simulation of calculation results of digital quadrature detection

2.3 Calculation quantity analysis

Usually, the number of times for real multiplication and complex addition is used to represent the computation of a machine. The computation of digital quadrature detection method mainly includes autocorrelation analysis and digital quadrature detection calculation. Autocorrelation is the convolution analysis of the resampling data of the sampled signal, and its computation is related to the sampling and resampling frequency. The computation of digital quadrature detection calculation is related to the length of the intercepted period and the highest order of harmonic analysis. The real multiplication times of digital quadrature detection method are expressed as:

$$Q_{{{\text{rm}}}} = N_{1}^{2} + 4 \times N_{2} \times H$$
(9)

where \(N_{1} = {\text{round}}\left( {\frac{{f_{{{\text{ex}}}} \times N}}{fs}} \right)\) is the number of resampled points from the sampled signal and \(N_{1}^{2}\) is the real multiplication times of autocorrelation analysis. \(N_{2} = {\text{round}}\left( {\frac{{f_{{\text{s}}} }}{{f_{{{\text{me}}}} }}} \right)\) is the length of full period data intercepted from the sampled signal. \(H\) is the highest order of harmonic analysis. \(4 \times N_{2} \times H\) is the real multiplication times of digital quadrature detection calculation.

The complex addition times is expressed as:

$$Q_{{{\text{ca}}}} = \frac{{N_{1} \times \left( {N_{1} - 1} \right)}}{2} + 2 \times N_{2} \times \left( {2H - 1} \right)$$
(10)

where \(\frac{{N_{1} \times \left( {N_{1} - 1} \right)}}{2}\) is the complex addition times of autocorrelation analysis and \(2 \times N_{2} \times \left( {2H - 1} \right)\) is the complex addition times of digital quadrature detection calculation. The real multiplication times and complex addition times of FFT are shown in Eq. (11).

$$\left\{ {\begin{array}{*{20}c} {Q_{{{\text{FFTrm}}}} = 4 \times \frac{N}{2} \times \log_{2} N} \\ {Q_{{{\text{FFTca}}}} = 3 \times N \times \log_{2} N} \\ \end{array} } \right.$$
(11)

Given the relevant parameters, the computation of the two methods under different conditions is shown in Table 1. When the order of harmonic analysis is lower than 15, the real multiplication and complex addition times of digital quadrature detection method are lower than those of FFT method.

Table 1 Comparison with the computation of FFT

2.4 Calculation of nonlinear distortion

The total harmonic distortion is used to characterize the nonlinear distortion of the signal [10], and the calculation formula is

$${\text{THD}} = \frac{{\sqrt {{\text{Amp}}_{1}^{2} + {\text{Amp}}_{2}^{2} + \cdots + {\text{Amp}}_{{\text{h}}}^{2} } }}{{{\text{Amp}}_{1} }} \times 100\% .$$
(12)

3 Experimental setup

To verify the advantages of the signal nonlinear distortion detection method based on the digital orthogonal detection principle in terms of computation cost, flexibility, and accuracy, an experimental device for detecting nonlinear distortion is designed. The device is composed of program-controlled amplification circuit, bias circuit, zero crossing comparison circuit, MCU core system, and display module, as shown in Fig. 4. The input signal is the harmonic signal generated by the function signal generator, and various parameters such as frequency and harmonic amplitude can be customized. The input signal is preprocessed by the program-controlled amplifier and the bias circuit before ADC sampling. MCU analyzes the signal peak information and changes the programmed gain coefficient through the DAC output voltage to adjust the signal amplitude within the ADC sampling voltage range.

Fig. 4
figure 4

System frame diagram

The zero-crossing comparison circuit converts the gain adjusted signal into a pulse signal. The counter and timer of MCU complete the signal frequency calculation and correct the sampling rate. MCU completes frequency estimation correction and distortion calculation according to Eqs. 112 and displays the calculation results on the display module.

4 Results

4.1 Verification of method calculation amount

To verify the optimization of the calculation amount of the digital orthogonal detection method, we select ARM Cortex-M4 Series MCU as the core processor, on which run the digital quadrature detection method (including autocorrelation frequency convolution calculation) to test the operation time of different points and different harmonic orders distortion. Every time the MCU completes the calculation process once, it will flip the level once at the I/O port. Use an oscilloscope to monitor the pulse width of the port level, as shown in Fig. 5.

Fig. 5
figure 5

DQD calculation time detection with oscilloscope

The MCU completes the analysis and calculation of the 5–15th-order total harmonic distortion at 128 points, 256 points, 512 points, and 1024 points, respectively. The test results are shown in Table 2.

Table 2 Time-consuming test results of method calculation

Table 2 shows that the higher the harmonic order or the more points to be calculated, the longer the calculation time. The calculation time of 5th-order and 15th-order total harmonic distortion is compared with that of FFT harmonic analysis method. The results of comparison of calculation time between two methods in Table 3 show that in the calculation from 128 to 1024 points, the calculation time of the digital quadrature detection method is reduced by 18.96–44.29% compared with calculate the FFT harmonic analysis method in the calculation of the 15th-order total harmonic distortion. If only the 5th-order total harmonic distortion, the operation time of digital quadrature detection method is reduced by more than 73% compared with FFT harmonic analysis method. The lower the requirement of the maximum harmonic order, or the more the number of calculation data points, the higher the reduction rate of the calculation amount of the digital orthogonal detection method. The experimental results of the calculation time are close to the analytical value of the theoretical calculation quantity, and the deviation is mainly reflected in the time of MCU processing some program links, such as cycle operation and judgment.

Table 3 Comparison of calculation time between FFT harmonic analysis method and digital quadrature detection method

4.2 Autocorrelation frequency correction verification

Accurate detection of the fundamental frequency of the signal is the basis of the analysis of the nonlinear distortion by digital quadrature detection. After the input signal is amplified by the program-controlled amplifier, the input zero crossing detection circuit converts it into a pulse signal, as shown in Fig. 6.

Fig. 6
figure 6

Amplified signal and zero-crossing test results

The frequency of the pulse signal detected by MCU port is counted according to the zero-crossing point within a certain time but cannot represent the fundamental frequency of the input signal. MCU corrects the frequency of zero crossing detection statistics by autocorrelation method on the sampled data according to Eqs. (14) and analyzes the accurate fundamental frequency. The results of measuring the frequency of input signals with different harmonic parameters are shown in Table 4, which shows that the zero-crossing detection and autocorrelation correction methods are accurate in analyzing the fundamental frequency of signals, with an error of less than 0.8%.

Table 4 Input signal frequency detection and correction results

4.3 Detection and verification of harmonic component and nonlinear distortion

Since accurate frequency detection, the complete period is extracted from the sampled data, and the magnitude of each harmonic component and nonlinear distortion are calculated by digital orthogonal detection method. To verify the accuracy of the method for harmonic components and nonlinear distortion, the digital orthogonal detection method is compared with the FFT harmonic analysis method. Since the number of points of FFT algorithm must be \(2^{N}\), the sampling rate of the experimental device is adapted in the experiment to minimize the spectrum leakage and fence effect of FFT, so that FFT has a higher harmonic analysis accuracy. For example, the fundamental frequency of the measured signal is 1150 Hz. When performing 256-point calculation, the signal sampling rate is set to 294.73 kHz. MCU clock error causes 0.33 kHz error, but when the number of sampling points is 256, the sampled data are also a complete cycle.

The measured signal is a harmonic signal customized by the function signal generator. The digital quadrature detection method is used to calculate the harmonic components of the customized signal, and the results are compared with those of FFT harmonic analysis method. The test results of the 5th-order total harmonic distortion of the customized signal are shown in Table 5. The measurement error of 5th-order total harmonic distortion by digital quadrature detection method is almost the same as that by FFT harmonic analysis method, and the error is less than 0.6%. Comparing the error of the two methods, the floating value is less than ± 0.25%.

Table 5 Test results of 5th-order total harmonic distortion of customized signal (256 points)

The test results of the 10th-order total harmonic distortion of the customized signal are shown in Table 6. The measurement error of 10th-order total harmonic distortion by digital quadrature detection method is almost the same as that by FFT harmonic analysis method, and the error is less than 2%. Comparing the error of the two methods, the floating value is less than ± 0.4%.

Table 6 Test results of 10th-order total harmonic distortion of customized signal (256 points)

The test results of the 15th-order total harmonic distortion of the customized signal are shown in Table 7. The measurement error of the 15th-order total harmonic distortion by digital quadrature detection method is almost the same as that by FFT harmonic analysis method, and the error is less than 5%. Comparing the error of the two methods, the floating value is less than ± 0.7%.

Table 7 Test results of 15th-order total harmonic distortion of customized signal

More importantly, the FFT harmonic analysis method is equivalent to the artificial reduction in its analysis error in the sampling rate adaptation and is sufficient to prove the advantages of the digital orthogonal detection method in the analysis accuracy.

5 Conclusion

Signal nonlinear distortion detection is an important means to test signal quality in many industries. In this paper, a digital quadrature detection method with low computation is proposed, and the measuring principle of the method is introduced in detail. Compared with the actual calculation time of the most used FFT harmonic analysis method, it is proved that the calculation amount of the total harmonic distortion of the signal measured by the digital orthogonal detection method is significantly lower than that of the FFT harmonic analysis method. Because the high-order harmonic of the signal has very little influence on the signal, it is usually ignored in the nonlinear distortion analysis. The digital quadrature detection method can omit the calculation of the high-order harmonic signal and is very suitable for low computational power microprocessors. Through experimental comparison, the measurement accuracy of digital quadrature detection method is high, and the measurement error level is almost the same as that of FFT harmonic analysis method.

Another advantage of the digital quadrature detection method in analyzing harmonic components is that the number of calculation points can be flexibly selected, and accurate harmonic components can be obtained if the integrity of signal cycle is guaranteed. However, FFT harmonic analysis method specifies a relatively fixed number of calculation points, and most of them are asynchronous sampling in the process of signal sampling, which leads to the leakage of spectrum analysis. Generally, to reduce the frequency leakage, the time width of signal sampling should be as large as possible, so the number of FFT analysis and calculation points is large, and the calculation amount will increase. Visibly, the digital quadrature detection method is more conducive to the lightweight and low cost of the detection instrument while ensuring the measurement accuracy.

Availability of data and materials

Please contact author for data requests.

Abbreviations

FFT:

Fast Fourier transform

THD:

Total harmonic distortion

DFT:

Discrete Fourier transform

ADC:

Analog-to-digital converter

MCU:

Microcontroller unit

DAC:

Digital-to-analog converter

ARM:

Advanced RISC machines

DQD:

Digital quadrature detection

References

  1. K. Jonghyeon, K. Julia, A method for detecting the existence of an over-discharged cell in a lithium-ion battery pack via measuring total harmonic distortion. Batteries 8(3), 26–26 (2022)

    Article  Google Scholar 

  2. K. Piotr, W. Grzegorz, Problem of total harmonic distortion measurement performed by smart energy meters. Meas. Sci. Rev. 22(1), 1–10 (2022)

    Article  Google Scholar 

  3. R.R. Das et al., Impact of temperature on radio frequency/linearity and harmonic distortion characteristics of Ge multi-channel fin shaped field-effect transistor. Int. J. RF Microwav. Comput.-Aid. Eng. 32(2), e22987 (2021)

    Google Scholar 

  4. R. Ingale, Harmonic analysis using FFT and STFT. Int. J. Sign. Process. Image Process. Pat. Recognit. 7(4), 345–362 (2014)

    MathSciNet  Google Scholar 

  5. S. Zhao, C. Wang, X. Bian, Research on harmonic detection based on wavelet threshold and FFT algorithm. Syst. Sci. Control Eng. 6(3), 339–345 (2018)

    Article  Google Scholar 

  6. R.P. Williams, On the formulation of convolution, autocorrelation and cross correlation. Eur. J. Phys. 7(1), 6 (1986)

    Article  MathSciNet  Google Scholar 

  7. Tu. Ya-Qing, Y.-L. Shen, Phase correction autocorrelation-based frequency estimation method for sinusoidal signal. Sign. Process. 130, 183–189 (2017)

    Article  Google Scholar 

  8. Su. Juan, J. Mingxing, J. Fei, Pound–Drever–Hall laser frequency locking technique based on orthogonal demodulation. Optik 168, 348–354 (2018)

    Article  Google Scholar 

  9. C. Wang, Qu. Yang, Y.P.T. Tang, IQ quadrature demodulation algorithm used in heterodyne detection. Infrared Phys. Technol. 72, 191–194 (2015)

    Article  Google Scholar 

  10. J. Zhang, Nonlinear distortion signal generation and THD measuring device. J. Phys.: Conf. Ser. 1802(2), 022024 (2021)

    Google Scholar 

Download references

Acknowledgements

We would like to thank the handing editor and the anonymous reviewers for their valuable comments and suggestions for this paper. This work was supported in part by Guangxi Innovation-driven Development Special Fund Project under Grant No. GuikeAA19254010.

Author Informations

Pengcheng Wang received the B.S. degree in applied electronic technology education from Yunnan Normal University, Kunming, China, in 2013. In 2013, he joined Guilin University of Technology as a junior experimentalist, and in 2018, he served as an experimentalist. His research interests include digital signal processing, embedded systems, and digital image processing.

Xiaoping Huang received the B.S. degree in automation from Hunan Industry University, Zhuzhou, China, in 1996, and the M.S. degree in control science and engineering from Guilin University of Technology, Guilin, China, in 2007. From 1996 to 2010, he was a senior engineer in Guilin Shuguang Rubber Industry Research and Design Institute. From 2011 to 2016, he was an associate professor at the college of mechanical and electrical engineering at Nanning University. From 2017 to Nov.2021, he was a professor at the college of mechanical and electrical engineering at the same University. From Dec.2021 to now, he is a professor at Guilin University of Technology. His research interests include intelligent manufacturing and complex nonlinear systems control.

Funding

This research was funded by Guangxi Innovation-driven Development Special Fund Project under Grant No. GuikeAA19254010.

Author information

Authors and Affiliations

Authors

Contributions

PW proposed the method of digital quadrature detection for signal nonlinear distortion detection and completed the theoretical deduction and simulation experiment. PW designed the system experiment device, completed the experiment, and wrote the manuscript. XH verified the feasibility of the theoretical method and reviewed the manuscript. XH will complete the submission and future correspondence as the corresponding author. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Xiao-Ping Huang.

Ethics declarations

Declarations

Ethics approval and consent to participate.

Not applicable.

Consent for publication

Not applicable.

Competing interests

We declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Wang, PC., Huang, XP. A low computation detection method of signal nonlinear distortion based on digital quadrature detection principle. EURASIP J. Adv. Signal Process. 2023, 63 (2023). https://doi.org/10.1186/s13634-023-01015-0

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s13634-023-01015-0

Keywords