A new generation of multipurpose measurement equipment is transforming the role of computers in instrumentation. The new features involve mixed devices, such as kinds of sensors, analog-to-digital and digital-to-analog converters, and digital signal processing techniques, that are able to substitute typical discrete instruments like multimeters and analyzers. Signal-processing applications frequently use least-squares (LS) sine-fitting algorithms. Periodic signals may be interpreted as a sum of sine waves with multiple frequencies: the Fourier series. This paper describes a new sine fitting algorithm that is able to fit a multiharmonic acquired periodic signal. By means of a “sinusoidal wave” whose amplitude and phase are both transient, the “triangular wave” can be reconstructed on the basis of Hilbert-Huang transform (HHT). This method can be used to test effective number of bits (ENOBs) of analog-to-digital converter (ADC), avoiding the trouble of selecting initial value of the parameters and working out the nonlinear equations. The simulation results show that the algorithm is precise and efficient. In the case of enough sampling points, even under the circumstances of low-resolution signal with the harmonic distortion existing, the root mean square (RMS) error between the sampling data of original “triangular wave” and the corresponding points of fitting “sinusoidal wave” is marvelously small. That maybe means, under the circumstances of any periodic signal, that ENOBs of high-resolution ADC can be tested accurately.
For robot sensors, ADC plays a key role, which receives the signal coming from front-end circuit and then converts it into digital logic output [
However, as for a sinusoidal sampling signal with harmonic distortion, whether using the classical three-parameter or four-parameter sine fitting methods, both of them will result in biased estimation [
But it is impractical to make use of one sinusoid for the evaluation of ADC when input signal is a harmonic signal or a triangular wave. The difference between a simple sine wave and a harmonic signal or the difference between a simple sine wave and a triangular wave is obviously great. Errors can arise in frequency, amplitude, and phase [
A maximum likelihood improved sine-wave fitting procedure for characterizing data acquisition (DAQ) channels and ADC, which is also capable of fitting multiple harmonics of an input signal, was presented in [
Next, some relatively simpler method presented in document [
It has been shown by the experimental results that the LS sine-fitting algorithm can fit up to 43 harmonics of a triangular wave with very good results. The dimension of computer memory limits the highest harmonic that can be considered in this method. It should be noted that there is no algorithm-related limitation regarding the number of harmonics or the highest possible harmonic to consider. The limitations are concerned with memory requirements and convergence of the nonlinear least-square method, as in [
In the LS sine-fitting algorithm a problem is the evaluation of the initial condition of the fundamental harmonic frequency, to guarantee the convergence. To overcome this problem, a method devoted to the improved evaluation of initial condition for the LS sine-fitting algorithm is presented in [
The Hilbert-Huang transform (HHT), which was first developed by Huang et al. at the end of the last century, is a novel signal analysis method. The HHT is derived from the principals of empirical mode decomposition (EMD) and Hilbert transform (HT) [
In this paper, one “sinusoidal” fitting method to the original triangular wave which is based on the HHT will be put forward, which can avoid the trouble of selecting the initial value of the parameters and working out the nonlinear equations compared to the LS sine-fitting algorithm. First of all, the EMD process is carried out on a triangular wave, and the originally got first-order IMF is used to reconstruct the triangular wave. Secondly, the HT process is carried out on the first-order IMF, then amplitude function and phase function of analytic signal corresponding to the reconstructed “triangular wave” are obtained, and so, the key parameters of the “sinusoidal curve” are achieved. The “sinusoidal curve” can simulate the original triangular wave very well, and its particularity lies in that the amplitude and phase of the “sinusoidal” curve are instantaneous; in other words, both the amplitude and phase vary with time. The simulation results show that, in the case of sufficient sampling points, the magnitude of the RMS error between the sampling data of triangular wave and corresponding points of fitting “sinusoidal” curve model is quite small, which proves that good fit is realized.
The algorithm of multiple harmonics least-squares fitting to estimate the offset, fundamental frequency, and the amplitude and phase values of the harmonics of a multiharmonic signal is detailed in the second section. The algorithm of HHT fitting to get the instantaneous amplitude and phase of the “sinusoidal curve” is detailed in the third section. The fourth section describes the numerical simulations and results based on two algorithms, respectively.
The sampled periodic signal may be described as a sum of sine waves with different frequencies, multiple of the fundamental
A set of
Independently of the number of harmonics
And so, the residuals
The LS method minimizes the sum of the residuals, while the total rms error is
The first step of the algorithm is to estimate the initial frequency
The
To determine the initial harmonic parameters, one two-column matrix for each harmonic:
To determine the estimated values of
The LS solution vector
The solution vector contains the harmonic parameters that minimize the rms error (
To also determine the best frequency, an iterative method is required that can, in iteration
The LS solution for iteration
After each iteration, the frequency estimate is updated using
This process is repeated based on the new values of
EMD method is developed from the simple assumption that any signal consists of different simple intrinsic modes of oscillations. In this way, each signal could be decomposed into a number of IMFs, each of which must satisfy the following two conditions: (a) in the whole data set, the number of extrema and the number of zero-crossings must either equal or differ at most by one; (b) at any point, the mean value of the envelope defined by local maxima and the envelope defined by the local minima is zero.
An IMF represents a simple oscillatory mode compared with the simple harmonic function. With that definition, any signal Identify all the local extrema of signal Repeat the procedure for the local minima to produce the lower envelope. The upper and lower envelopes should cover all the data between them. The mean of upper and low envelope value is designated as If the sifting result Denote by
As in Huang et al., the stopping condition in Step
After obtaining the IMFs, we apply the HT on each IMF:
By definition, the analytic signal corresponding to each IMF is
According to the analytic signal,
The instantaneous amplitude and instantaneous phase of the analytic signal are defined in the usual manner and can, respectively, be represented as
The analytic signal represents the time-series as a slowly varying amplitude envelope modulating a faster varying phase function [
The whole process of this method can be described as follows.
Carry out the “EMD” decomposition on the originally collected periodic signal which contains multiple harmonics firstly, and then get a series of component products called “IMF.”
Because the “EMD” process always extracts the most principal information firstly, so the primary “IMF1” component which is firstly got can represent the principal component of the original periodic signal. Then the following fitting calculation will utilize “IMF1.”
In order to minimize the “end swing” effect caused by EMD as far as possible, with regard to the decomposed IMF1, the sampling data in the middle minizone which have high linearity are selected. We usually utilize only the data sample which have the same number as the sample collected within one cycle of primitive periodic signal, instead of the most sampled data of both ends.
The sampling sequence in the minizone of the above-mentioned IMF, in accordance with the corresponding moment, is looked on as the sampling sequence within one cycle of a new “periodic signal.”
This “periodic signal” in single cycle is periodically extended to the both ends; then a continuous “periodic signal” is constructed.
Select some segment data of the above-mentioned “periodic signal” which can be represented to be
Apply the “HT” on the “fitted signal” which can be represented to be
Construct the analytic signal of
Describe
The amplitude function
The two representations express the instantaneous amplitude and the instantaneous phase clearly, and they reflect the instantaneous characteristics of data very well.
Describe the fitted residue
Express the total mean square error by
As we know, the ENOBs of ADC can be expressed as
Next, to illustrate the effectiveness and the superiority of the new “fitting” method mentioned in this paper, with simulation, we will compare the result of new “fitting” method and that of the least-squares fitting method of multiple harmonics. All parameters are the same as those in [
As for a triangular wave signal source with the amplitude of
Firstly, the least-squares fitting method for multiple harmonics is taken for simulation. In the fitting process, the total mean square error is the function of the highest harmonic number
The influence of both the highest harmonic number
Then the second approach is taken for simulation, which is based on HHT curve fitting method, which is based on the HHT curve fitting method. Then next, with the acquisition of 10.5 cycles, or in other words, 1000 sampling points of the original signal source being taken as an example, the specific process for application of the HHT method to fit the triangle wave signal source is expounded.
The signal source is shown as Figure
The original triangle wave signal source.
Components of eight IMFs are obtained in proper sequence as the EMD is carried out on the signal source, and the distribution diagrams are shown in Figure
The distribution diagrams for components of eight IMFs got with the EMD carried out on the signal source.
It can be seen from Figure
The periodic extension base generated on the basis of the first-order IMF component.
With periodic extension carried out on the single minizone to both ends, a continuous “periodical signal” is constructed, and with the appropriate interval selected, the “triangular wave” with 1000 sampling points which matches the “original signal” is constructed at last. The constructed waveform is shown as Figure
The reconstructed “triangle wave” generated after periodic extension.
Thus, the reconstructed “triangular wave” is very similar to the “original signal waveform.” Hence, take the “triangular wave” as the “fitted signal” and apply the “HT” on it, and so the analytical signal is obtained. After the instantaneous amplitude and instantaneous phase of fitted “sinusoidal” are got, the fitted residue can be easily obtained; thus in the end the root mean square error is obtained to be 29.374 mV.
Because of the end effect of EMD, that accuracy is not so ideal and the error is comparatively large. As a result of insufficient sampling points, the “end swing” phenomenon pollutes the whole data sequence, including the medial data. After the EMD is carried out on the original triangle wave, taking the single middle full “cycle” minizone of IMF1 as the periodic extension base of the fitted triangle wave, it can be found out that the periodic extension base has a large difference from the single cycle of the original triangle wave, and that means there exists relatively large distortion.
Because the end effect is mainly concentrated in both ends of the signal, as the waveform of IMF1 in Figure
Taking simulation experiment of “sinusoidal fitting” for “triangular wave” with sampling points, respectively, of 1500, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 12000, and 20000, the different calculated RMS error can be shown, respectively, in Table
The different RMS error caused by different sampling points after carrying on “sinusoidal fitting” for “triangular wave” based on HHT.
Sampling points | RMS error (mV) |
---|---|
|
10.571 |
|
4.442 × 10−1 |
|
2.282 × 10−2 |
|
9.599 × 10−4 |
|
8.548 × 10−6 |
|
1.415 × 10−7 |
|
1.074 × 10−8 |
|
3.367 × 10−10 |
|
1.735 × 10−12 |
|
2.344 × 10−13 |
|
2.150 × 10−13 |
|
2.312 × 10−13 |
It can be seen from the table that, as the number of sampling points is taken as 1500 or 2000, the RMS error of fitting is not ideal. But once the number is 3000, you can find out that the fitting accuracy can almost compare favourably with the multiple harmonics fitting accuracy with 15 harmonics considered (referring to Figure
As the “triangular wave” is fitted as above, it can be comprehended by analogy that any periodic wave can be reconstructed by the “sinusoid fitting” algorithm based on the HHT; in other words, any original “periodic wave” can be characterized as the “sinusoidal wave” whose amplitude and phase are both transient.
Unlike the classical least-squares fitting algorithm for multiple harmonic periodic signals which combines “four-parameter algorithm” with “three-parameter algorithm” that presented in the IEEE standards, the new “sinusoid fitting” algorithm based on the HHT avoids selecting the initial values of the parameters and working out the nonlinear equations. So the fact in the IEEE standards that the frequency and amplitude errors from the foremost calculation are propagated to the higher harmonics and the calculation of the
The simulation results show that, once the number of sampling points reaches a certain amount, the reconstructed waveform could be a very good reproduction of the original waveform, and it means that the fitting algorithm based on the HHT method can achieve perfect accuracy.
Firstly, this paper explains why it would bring great error in the circumstance of nonsinusoidal periodic signal source, if “three-parameter algorithm” or “four-parameter algorithm” that presented in the IEEE standards was merely used to test the ADC, and then the significance of researching multiple harmonics fitting comes out.
Secondly, the principle and realization process of some kind of multiple harmonics fitting method proposed by Portuguese researchers is introduced—that is, the least-square fitting algorithm which combines the “four-parameter algorithm” and “repeated three-parameter algorithm”.
Secondly, the new research method in this paper is introduced in detail—that is, using the “sinusoidal wave” whose amplitude and phase are both transient to reconstruct the “triangular wave” based on the HHT.
That algorithm can be described as follows: the EMD process is carried out on a triangular wave first of all, and then part of the inner data of the originally got first-order IMF is looked on as the periodic extension base to reconstruct the triangular wave. After the “HT” is applied on the reconstructed “triangular wave,” then the corresponding analytic signal is obtained, and so the reconstructed “triangular wave” can be characterized as the special “sinusoidal curve” with parameters changing with time.
Finally, in order to illustrate the effectiveness and the superiority of the new “fitting” method mentioned in this paper, the same example in [
We can come to a conclusion that the new sine fitting algorithm described in this paper is able to fit a multiharmonic acquired periodic signal. And with this method, the ENOBs of ADC may be tested out, avoiding the trouble of selecting initial value of the parameters and working out the nonlinear equations in the commonly used algorithm.
The authors would like to thank the financial support of the National Natural Science Foundation of China (Grant no. 61104206), the Natural Science Foundation of Anhui Province (Grant no. 1208085QF121), and the Postdoctoral Scientific Research Plan of Jiangsu Province (Grant no. 1102038C). The authors are very grateful to the unknown referees for their valuable remarks.