# Multiple Harmonics Fitting Algorithms Applied to Periodic Signals Based on Hilbert-Huang Transform

Authors: Hui Wang; Zhengshi Liu; Bin Zhu; Quanjun Song
Journal: Journal of Sensors
 (2013)

---

## Abstract

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.


---

## Body

## 1. Introduction

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 [1, 2]. ADC testing frequently uses periodic signals to obtain most of the specification parameters, such as the ENOBs, signal-to-noise and distortion (SINAD) ratio, integral nonlinearity (INL), differential nonlinearity (DNL), and the transfer function. Sine fitting is a very efficient and fast way to help in the evaluation of most of these characteristic parameters. IEEE standards 1057 [3] and 1241 [4] present two methods that estimate three (amplitude, phase, and dc component) or four parameters (including also the frequency) of a sine wave that best fit a set of acquired samples. The two sine fitting methods described by IEEE standards are general and classical methods aiming at the data acquisition channel as well as the ADC demarcation.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 [5].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 [6].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 [5]. A different method was proposed in [7] based on the spectral analysis and fitting by interpolating the acquired samples. Moreover, several other algorithms were proposed to fit multiple harmonics in [8–10]. However, the application of those methods is much complex.Next, some relatively simpler method presented in document [6, 11] using the IEEE standards was proposed to best fit multiple harmonics particularly. This is an LS sine-fitting algorithm based on four-parameters sine fitting at first and three-parameters sine fitting afterwards aiming at the periodic signal containing multiple harmonics.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 [3, 4].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 [12]. In particular, the method is based on the algebraic derivative approach in the frequency domain.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) [13, 14]. With EMD, any complicated data set can be decomposed into finite (often less) number of intrinsic mode functions (IMFs) which admit well-behaved Hilbert transform (HT). With HT, each IMF yields its instantaneous frequency (IF), phase, and envelope as functions of time. The wavelet methods are also popular approaches for performing both decomposition and reconstruction for signals and analyzing the frequency of signals, but the results of wavelet transform depend on the selection of wavelet base [15]. In contrast, the HHT method is self-adaptive, unnecessary to select the base functions, and the results are more stable.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.


## 2. Least-Squares (LS) Multiharmonic Fitting Method [6]

The sampled periodic signal may be described as a sum of sine waves with different frequencies, multiple of the fundamental(f), individual amplitudes (Dh), and phases (ϕh):
(1)y(t)=C+∑h=1HDhcos(2hπft+ϕh).A set ofM samples, (y1,…,ym,…,yM), is acquired at a sampling frequency fs. To each sample, a relative timestamp is attributed according to the sample number and the sampling frequency:
(2)tm=m-1fs.Independently of the number of harmonicsH in the input signal, the method can determine only the amplitudes and phases of the first N  (N≤H) harmonics.And so, the residualsrm of fitting are
(3)rm=ym-C^-∑n=1N[A^ncos(2nπf^tm)+B^nsin(2nπf^tm)],
where C^ is the estimated dc component and f^ is the estimated frequency. A^n and B^n are the orthogonal estimated amplitudes of harmonic n. The amplitudes and the phases of the harmonics are determined by
(4)D^n=A^n2+B^n2,ϕn=arctan2(B^n,A^n).The LS method minimizes the sum of the residuals, while the total rms error is(5)ρ=1M∑m=1Mrm2.The first step of the algorithm is to estimate the initial frequencyf^0 by an interpolated fast Fourier transform [16]. With this frequency, a set of initial estimated parameters are determined like in the three-parameter sine-fitting algorithm of [3, 4]. This estimation is done in one noniterative step, producing the harmonic amplitudes and phases that minimize the total rms error for the frequency f^0.They matrix contains the sample values:
(6)y=[y1⋯ym⋯yM]T.To determine the initial harmonic parameters, one two-column matrix for each harmonic:(7)Wn=[cos(nΩ)sin(nΩ)]
with Ωm=2πf^tm is used.To determine the estimated values ofC^, A^n, and B^n, the full LS matrix is
(8)D=[1W1⋯Wn⋯WN].The LS solution vector(9)x^0=[C^A^1B^1⋯A^nB^n⋯A^NB^N]T
is determined by
(10)x^0=(DTD)-1(DTy).The solution vector contains the harmonic parameters that minimize the rms error (5) for the interpolated discrete Fourier transform (IpDFT) frequency f^0.To also determine the best frequency, an iterative method is required that can, in iterationi, adjust all the parameters Ci, Ani, Bni, and ωi=2πfi, which minimize the total residual error. In order to include the frequency, vector Q(11)Qm=∑n=1N-Ani-1ntmsin(nΩmi-1)+Bni-1ntmcos(nΩmi-1)
with Ωmi-1=ωi-1tm is used in the new full LS matrix:
(12)Di=[Q1W1⋯Wn⋯WN].The LS solution for iterationi is obtained by
(13)x^i=[(Di)TDi]-1[(Di)Ty],
where the solution vector is now
(14)x^i=[ΔωiCiA1iB1i⋯AniBni⋯ANiBNi]T.After each iteration, the frequency estimate is updated usingωi=ωi-1+Δωi-1.This process is repeated based on the new values ofAni, Bni, and ωi. The iterations stop when the frequency changes are suitably small.


## 3. “Sinusoidal” Fitting Method Based on HHT

### 3.1. EMD Method [13, 14]

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 signals(t) can be decomposed as follows.(1)
Identify all the local extrema of signals(t), and then connect all the local maxima by a cubic spline line as the upper envelope.(2)
Repeat the procedure for the local minima to produce the lower envelope. The upper and lower envelopes should cover all the data between them.(3)
The mean of upper and low envelope value is designated asm(t); and the difference between the signal s(t) and m(t) is h(t), that is, s(t)-m(t)=h(t).(4)
If the sifting resulth(t) is an IMF, stop. Otherwise, treat h(t) as the original signal and iterate on h(t) through Steps (1), (2), (3).(5)
Denote byc1(t) the first IMF and set r1(t)=s(t)-c1(t) the first residue. The algorithm proceeds to select the next IMF by applying the above procedure to the first residue r1(t). This process is repeated until the last residue rn(t) has at most one extremum or becomes constant. The signal s(t) then can be represented as
(15)s(t)=∑i=1nci(t)+rn(t).As in Huang et al., the stopping condition in Step(4) is to limit the following standard deviation from two consecutive results in the sifting process:
(16)SD≥∑i=0T[hm-1(t)-hm(t)]2hm-1(t)2,
where T is the length of the signal and hm(t) is the sifting result in the mth iteration. A typical stopping value of SD is set between 0.2 and 0.3.


### 3.2. HT

After obtaining the IMFs, we apply the HT on each IMF:(17)H[ci(t)]=ci(t)*1πt=1πP∫-∞∞ci(τ)t-τdτ,
where P denotes the principal Cauchy value.By definition, the analytic signal corresponding to each IMF is(18)zi(t)=ci(t)+jH[ci(t)]=ai(t)eiθi(t),
where ai(t) and θi(t) are the instantaneous amplitude and the instantaneous phase, respectively, of the signal at time t.According to the analytic signal,ci(t) can be represented as
(19)ci(t)=ai(t)cosθi(t).The instantaneous amplitude and instantaneous phase of the analytic signal are defined in the usual manner and can, respectively, be represented as(20)ai(t)=|zi(t)|=ci(t)2+H[ci(t)]2,θi(t)=arg[zi(t)]=arctan(H[ci(t)]ci(t)).The analytic signal represents the time-series as a slowly varying amplitude envelope modulating a faster varying phase function [17]. The IF is then given by
(21)fi(t)=(12π)d[θi(t)]dt.


### 3.3. “Sinusoidal Fitting” Process Based on HHT

The whole process of this method can be described as follows.Step 1.
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.”Step 2.
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.”Step 3.
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.Step 4.
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.”Step 5.
This “periodic signal” in single cycle is periodically extended to the both ends; then a continuous “periodic signal” is constructed.Step 6.
Select some segment data of the above-mentioned “periodic signal” which can be represented to be(C1,…,Cm,…,CM) as the sequence of “fitted signal,” and the relationship between this sequence and the sampling sequence of “original signal” which can be represented to be (y1,…,ym,…,yM) should be C1≈y1 and c1-c2≈y1-y2 (i.e., initial slope has the same plus or minus sign).Step 7.
Apply the “HT” on the “fitted signal” which can be represented to beH[c(t)]=c(t)*1/πt=P.V.∫-∞∞(c(t-τ)/πτ)dτ (where P.V. denotes the Cauchy principal value integral).Step 8.
Construct the analytic signal ofc(t), and the representation can be expressed as z(t)=c(t)+iH[c(t)]=a(t)e-iϕ(t). It further demonstrates the local characteristics by polar coordinate expression which is the best local approximation of a trigonometric function, and both amplitude and phase of that trigonometric function change.Step 9.
Describec(t) in “sine” function form, out of the ordinary, the amplitude and phase of which are changing with time. That well reflects the instantaneous characteristics of data, which is a function with unique amplitude and phase definition that can be expressed as
(22)c(t)=a(t)cosϕ(t)=a(t)sin[ϕ(t)+π2].Step 10.
The amplitude functiona(t) and the phase function ϕ(t)+π/2 of this “sinusoidal” can be expressed, respectively, as
(23)a(t)=c(t)2+H[c(t)]2,ϕ(t)+π2=arctan{H[c(t)]c(t)}+π2.
The two representations express the instantaneous amplitude and the instantaneous phase clearly, and they reflect the instantaneous characteristics of data very well.Step 11.
Describe the fitted residuerm as follows:
(24)rm=ym-C^-c(tm)=ym-C^-a(tm)sin[ϕ(tm)+π2],
where ym is the mth sampling datum, C^ is the estimation of the DC component, tm is the mth sampling moment, a(tm) and ϕ(tm)+π/2 are the instantaneous amplitude and the instantaneous phase of fitted “sinusoidal” at the moment of tm, respectively.Step 12.
Express the total mean square error by(25)ρ=1M∑m=1Mrm2,
where M is the number of elements which sampling sequence contains.As we know, the ENOBs of ADC can be expressed asENOBs=N-log2(ρ/Qi), where N is the number of bits of ADC, ρ is the total RMS error between the sampling data of originally collected periodic signal containing multiple harmonics and the corresponding points of fitting “sinusoidal wave”, and Qi is the theoretical values of RMS quantization error which can be expressed as Qi=Er/(12×2N), where Er is the range of ADC channel. According to those equations, in the circumstances that both the number of bits of ADC and the range of ADC channel are certain, we can come to a conclusion that the ENOBs of ADC would be evidently larger with the smaller total RMS error.


## 3.1. EMD Method [13, 14]

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 signals(t) can be decomposed as follows.(1)
Identify all the local extrema of signals(t), and then connect all the local maxima by a cubic spline line as the upper envelope.(2)
Repeat the procedure for the local minima to produce the lower envelope. The upper and lower envelopes should cover all the data between them.(3)
The mean of upper and low envelope value is designated asm(t); and the difference between the signal s(t) and m(t) is h(t), that is, s(t)-m(t)=h(t).(4)
If the sifting resulth(t) is an IMF, stop. Otherwise, treat h(t) as the original signal and iterate on h(t) through Steps (1), (2), (3).(5)
Denote byc1(t) the first IMF and set r1(t)=s(t)-c1(t) the first residue. The algorithm proceeds to select the next IMF by applying the above procedure to the first residue r1(t). This process is repeated until the last residue rn(t) has at most one extremum or becomes constant. The signal s(t) then can be represented as
(15)s(t)=∑i=1nci(t)+rn(t).As in Huang et al., the stopping condition in Step(4) is to limit the following standard deviation from two consecutive results in the sifting process:
(16)SD≥∑i=0T[hm-1(t)-hm(t)]2hm-1(t)2,
where T is the length of the signal and hm(t) is the sifting result in the mth iteration. A typical stopping value of SD is set between 0.2 and 0.3.


## 3.2. HT

After obtaining the IMFs, we apply the HT on each IMF:(17)H[ci(t)]=ci(t)*1πt=1πP∫-∞∞ci(τ)t-τdτ,
where P denotes the principal Cauchy value.By definition, the analytic signal corresponding to each IMF is(18)zi(t)=ci(t)+jH[ci(t)]=ai(t)eiθi(t),
where ai(t) and θi(t) are the instantaneous amplitude and the instantaneous phase, respectively, of the signal at time t.According to the analytic signal,ci(t) can be represented as
(19)ci(t)=ai(t)cosθi(t).The instantaneous amplitude and instantaneous phase of the analytic signal are defined in the usual manner and can, respectively, be represented as(20)ai(t)=|zi(t)|=ci(t)2+H[ci(t)]2,θi(t)=arg[zi(t)]=arctan(H[ci(t)]ci(t)).The analytic signal represents the time-series as a slowly varying amplitude envelope modulating a faster varying phase function [17]. The IF is then given by
(21)fi(t)=(12π)d[θi(t)]dt.


## 3.3. “Sinusoidal Fitting” Process Based on HHT

The whole process of this method can be described as follows.Step 1.
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.”Step 2.
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.”Step 3.
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.Step 4.
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.”Step 5.
This “periodic signal” in single cycle is periodically extended to the both ends; then a continuous “periodic signal” is constructed.Step 6.
Select some segment data of the above-mentioned “periodic signal” which can be represented to be(C1,…,Cm,…,CM) as the sequence of “fitted signal,” and the relationship between this sequence and the sampling sequence of “original signal” which can be represented to be (y1,…,ym,…,yM) should be C1≈y1 and c1-c2≈y1-y2 (i.e., initial slope has the same plus or minus sign).Step 7.
Apply the “HT” on the “fitted signal” which can be represented to beH[c(t)]=c(t)*1/πt=P.V.∫-∞∞(c(t-τ)/πτ)dτ (where P.V. denotes the Cauchy principal value integral).Step 8.
Construct the analytic signal ofc(t), and the representation can be expressed as z(t)=c(t)+iH[c(t)]=a(t)e-iϕ(t). It further demonstrates the local characteristics by polar coordinate expression which is the best local approximation of a trigonometric function, and both amplitude and phase of that trigonometric function change.Step 9.
Describec(t) in “sine” function form, out of the ordinary, the amplitude and phase of which are changing with time. That well reflects the instantaneous characteristics of data, which is a function with unique amplitude and phase definition that can be expressed as
(22)c(t)=a(t)cosϕ(t)=a(t)sin[ϕ(t)+π2].Step 10.
The amplitude functiona(t) and the phase function ϕ(t)+π/2 of this “sinusoidal” can be expressed, respectively, as
(23)a(t)=c(t)2+H[c(t)]2,ϕ(t)+π2=arctan{H[c(t)]c(t)}+π2.
The two representations express the instantaneous amplitude and the instantaneous phase clearly, and they reflect the instantaneous characteristics of data very well.Step 11.
Describe the fitted residuerm as follows:
(24)rm=ym-C^-c(tm)=ym-C^-a(tm)sin[ϕ(tm)+π2],
where ym is the mth sampling datum, C^ is the estimation of the DC component, tm is the mth sampling moment, a(tm) and ϕ(tm)+π/2 are the instantaneous amplitude and the instantaneous phase of fitted “sinusoidal” at the moment of tm, respectively.Step 12.
Express the total mean square error by(25)ρ=1M∑m=1Mrm2,
where M is the number of elements which sampling sequence contains.As we know, the ENOBs of ADC can be expressed asENOBs=N-log2(ρ/Qi), where N is the number of bits of ADC, ρ is the total RMS error between the sampling data of originally collected periodic signal containing multiple harmonics and the corresponding points of fitting “sinusoidal wave”, and Qi is the theoretical values of RMS quantization error which can be expressed as Qi=Er/(12×2N), where Er is the range of ADC channel. According to those equations, in the circumstances that both the number of bits of ADC and the range of ADC channel are certain, we can come to a conclusion that the ENOBs of ADC would be evidently larger with the smaller total RMS error.


## 4. Digital Simulation

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 [6]: the amplitude of the triangle wave signal source is 1 V, the frequency is 1 kHz, the cycle is 1 ms, and the sampling frequency is 95.08 KHz. That means that 95.08 samples should be sampled in each cycle. The reason to choose that sampling frequency is to ensure that the phase of signal collected  in each cycle was different, which can make the simulation more accord with actual condition and more convincing as well.As for a triangular wave signal source with the amplitude ofA, the exact harmonic amplitude is
(26)Dk={8A(πh)2hisodd,0hiseven.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 numberN of harmonic component and the number M of sampling points, as shown in Figure 1. Along with the harmonic number considered in the fitting process becoming higher and higher, the total mean square error comes to be smaller and smaller. Once the number of sampling points considered in the harmonic fitting process is more than 500, then the number of sampling points contributes less on the total RMS error [6].Figure 1
The influence of both the highest harmonic numberN of harmonic component and the number M of sampling points on the total RMS error in the least-squares fitting method for multiple harmonics.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 Figure2.Figure 2
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 Figure3.The distribution diagrams for components of eight IMFs got with the EMD carried out on the signal source.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)It can be seen from Figure3 that the first-order IMF component which is decomposed out firstly can reflect the original waveform mostly. We select the sampling high-linearity data in the middle minizone. It should be mentioned out that the data sample must have the same number as the sample collected within one cycle of primitive periodic signal. And so, the single middle full cycle minizone, in accordance with the corresponding time period, can be looked on as the periodic extension base of the periodic wave, and the single cycle waveform is shown as Figure 4.Figure 4
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 Figure5.Figure 5
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 Figure3 shows, the end effect has a relatively little effect on the center data. Therefore, in order to decrease the impact of “end swing” to the lowest, we can increase the number of sampling periods so that the number of sampling points is increased; in this way, even if the end effect does exist, it brings rather little contamination on the center data.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 Table1.Table 1
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)
1500
10.571
2000
4.442 × 10−1
3000
2.282 × 10−2
4000
9.599 × 10−4
5000
8.548 × 10−6
6000
1.415 × 10−7
7000
1.074 × 10−8
8000
3.367 × 10−10
9000
1.735 × 10−12
10000
2.344 × 10−13
12000
2.150 × 10−13
20000
2.312 × 10−13It 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 Figure1). As the number of sampling points is more than 4000, the fitting precision is even much better than the multiple harmonics fitting precision. For example, as the number of sampling points is taken as 10000, the RMS error goes as far to 10−13 mV grade. It can be concluded that the method using the “sinusoidal wave” whose amplitude and phase are both transient to reconstruct the “triangular wave” based on the HHT has almost reproduced the original “triangular wave” perfectly. From the beginning of 10000, even though the number of sampling points increases, the fitting precision could not improve, for that does mainly have something to do with the data accuracy of the computer.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 thenth harmonic will invariably be contaminated by the errors of the phases and amplitudes of previous steps would be avoided. Firstly, the “EMD” decomposition is carried out on the original periodic signal source, and the primary firstly-extracted “IMF1” component is got which can most reflect the original signal characteristics. Secondly, the inner data are looked on as the periodic extension base, and then the original waveform is reconstructed. Thirdly, the “HT” is applied on the reconstructed waveform, and then the analytic signal is got. In the end, the reconstructed waveform can be characterized as the “sinusoidal curve” whose amplitude and phase are both transient.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.


## 5. Conclusion

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 [6] is given and simulated using our method. The simulation experiment results show that, in the case of enough sampling points, even under the circumstances of low-resolution signal with the harmonic distortion existing, the RMS error between the sampling data of original “triangular wave” and the corresponding points of fitting “sinusoidal wave” is marvelously small. That means the accuracy of new fitting algorithm in this paper is much higher than that in [6].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.



---

*Source: 580152-2013-06-06.xml*