INTRODUCTION
As the water source in mountainous areas is abundant and of high drop, enhancing
the construction of small hydro is of great practical significance when currently
energy resources are in shortage. But the instability of small hydro and the
harmonic and interharmonic pollution caused by synchronizing small hydro also
bring lots of problems to the rapid development of small hydro. How to well
handle these problems is an important project of developing small hydro (Ge
and Song, 2011; Lin and Du, 2009). And harmonic
and interharmonic detection is the core of solving this problem. Only if the
harmonic and interharmonic component caused by small hydro synchronization
can be realtime monitored quickly, accurately and reasonably, can we be in
charge of the practical situation of harmonic and interharmonic precisely and
manage it properly (Liang, 2007). Therefore, the detection
of harmonic and interharmonic has great significance for accelerating the development
of small hydro.
At present, there are many ways to detect harmonic and interharmonic. According
to their different measuring principles, the most commonly used methods include
the one based on instantaneous reactive power theory, another method based on
wavelet transformation theory (Salem et al., 2007;
Idi and Kamarudin, 2012), the detection method based
on neural network theory, a forth method based on modern spectrum estimation
theory (Mingde and Zhigang, 2011) and the method based
on Fourier transformation theory etc. (Jiasheng et al.,
2012). Nowadays, FFT algorithm is still one of the most popular applied
in the harmonic and interharmonic detection. Nevertheless, if using the FFT
algorithm directly to detect harmonic and interharmonics would lead to problems
such as picket fence effect, spectrum leakage and aliasing. The result detected
would be inaccurate as being influenced by these negative factors. Adopting
interpolation algorithm can lower the impact brought by picket fence effect
effectively. The error arose by spectrum leakage needs the window function to
eliminate. After discussing the characteristics of each window functions (Sharma
and Agarwal, 2012), this study proposes a Hanning FFT interpolation revised
algorithm for the detection of harmonic and interharmonic caused by small hydro
synchronization and compares the several situations with different window functions.
ADDWINDOW INTERPOLATION ALGORITHM PRINCIPLE
FFT algorithm: Fast Fourier Transformation (FFT) is a fast algorithm
of Discrete Fourier Transformation (DFT). The FFT algorithm in this paper goes
like this: according to the features of sine and cosine functions (ZuHua,
2010), by using mathematics transformation to transform the voltage or fundamental
wave in electric current signals or each harmonic component into DC component;
using lowpass filtering to extract DC component and calculating fundamental
component and the amplitude of each harmonic component and parameters like phase
function; Subtracting fundamental wave and harmonic component from voltage signals
and getting voltage only with each interharmonic or electric current signals;
by searching the maximum amplitude to get the functions of each harmonic. As
shown in Fig. 1 is the harmonic and interharmonic detection
process based on Time Domain Average (TDA) and Difference Filter (DF).
When synchronizing small hydro power stations, we often distort the grid electric current and voltage into periodically nonsinusoidal wave signals, which generally meet the Dirichet conditions. Therefore, it can be break down into the following forms of Fourier series:
where,
is the function of DC component, C_{1}sin(nωt+φ_{1}) is
called fundamental component, C_{n}sin(nωt+φ_{n}) (n≥2)is
higher harmonic. Presume in a constant period of time, taking samples from voltage
and current averagely and getting a sample sequence u_{k}, from which
take out N points from a period T and records as {u_{k}} = u_{0},
u_{1}, u_{2}, …, u_{n1}, according to the data
of discrete time sequence {u_{k}} and on the basis of discrete Fourier
transformation theory, we can deduce to calculate the n harmonic coefficient.
The formulas of A_{n} and B_{n }are as follows:
n = 1, 2, 3, …, N1, then the amplitude of the n harmonic is .
Addwindow interpolation algorithm: Although the FFT algorithm is quick
in calculation and can reach high accuracy by meeting the sampling law when
synchronizing samples (Hui and Yang, 2010), frequency
spectrum leakage and picket fence effect still exist. This paper will lower
the frequency spectrum leakage by adding windows and eliminate the error caused
by picket fence effect through interpolation. Therefore, the algorithm used
in detecting harmonic and interharmonic consists of two aspects: (1) Choosing
of window function and (2) Interpolation algorithm.

Fig. 1: 
TDA harmonic and interharmonic detection process 
Choosing of window function: In the method of addwindow interpolation,
the choosing of window function is very important. We can restrain long range
leakage by choosing appropriate window function (Li and
Chai, 2009; Qi et al., 2003). When analyzing
frequency spectrum, it requires the window function to be narrow in main lobe
and low in side lobe and fast in drop speed. But for the same window function
it is hard to satisfy these requirements at the same time. When processing signals,
we should choose windows according to the signal’s characteristic and research
purpose. At present, there are 20 plus frequently used window functions which
mainly include cosine window and convolution window. Usually, grid signals are
primary with integer harmonic (Qi and Wang, 2003; Li
et al., 2008). Thus we often adopt composition window based on cosine
window. For such kind of window, if the selected observation time is the integral
multiple of signal period, its frequency spectrum amplitude is zero in each
integral multiple harmonic frequency. So there is no mutual leakage between
waves. Even if the signal frequency makes small range fluctuation (Pang
et al., 2003), the leakage error is still small. The more the number
of window items are, the bigger the width of the main lobe is; thus it leads
to the drop of frequency spectrum resolution. Meanwhile, more window function
items can lead to great reduction of side lobe, which is benefit for improving
the accuracy of calculating frequency spectrum. But generally speaking, the
composite window items should no more than 4.
In practical application, the frequently used windows are rectangle window,
Hanning window, Hamming window, Blackman window. The main lobe of rectangle
window is narrow while its side lobe is big. Its frequency recognition is the
most accurate but with the least amplitude recognition accuracy. For Blackman
window, the reduction of side lobe is great but its calculation is relatively
complex. The reduction of Hamming window side lobe is bigger than that of Hanning
window but with the increase of side lobe, the reduction speed slows down. If
we choose Hanning window, not only its calculating amount is small but also
we can adjust and analyze the window width to decrease interharmonic leakage.
The expression of Hanning window employed in this study and its DTFT results
are:
In order to keep its universality, we set the m harmonic signal as:
The cut off sequence of signals after sampling and adding window is:
where, x_{m}(nT_{s}) in this expression is the indefinite length sample sequence of x_{ma}(t). T_{s }is the sampling period. The sampling frequency is f_{s}=1/T_{s}. ω_{H}(n) is Hanning window, N is the amount of sample points and f_{m }is the harmonic wave frequency. The frequency spectrum of the indefinite length sample sequence x_{ma} = (nT_{s}) is x_{ma}(e^{jω}) = 2πδ(ωω_{m}). According to the property of Fourier transformation, the DTFT value x_{m}(e^{jω}) of sample sequence x_{m}(n) after adding window and cutting off is:
Further, we set the harmonic wave signal sampling sequence’s corresponding disperse frequency point as k_{m}+δ_{m} = (N.f_{m})/f_{s}. In this expression, k_{m} is an integral munber and 0 = δ_{m}<1, Meanwhile, considering that the sampling point amount N is often relatively great and d_{m}<1, so:
Suppose that ,
then we can get δ_{m} = (2β_{m}1)/(1+β_{m}).
From the above expressions we can get the harmonic amplitude, frequency and
the estimated phase, which are as follows:
Interpolation algorithm: Suppose the frequency as f_{0}, amplitude as A and initial phase as θ. After converting the sample frequency f_{s }from analog to digital, we can get the following form of discrete signal:
If the time domain form of the added function is ω(n) and its constant frequency spectrum is W(2πf), then after adding window the signal’s constant Fourier is transformed into:
If we neglect the side lobe effect of negative frequency point in the frequency peakf_{0}, the constant frequency spectrum function nearby positive frequency point f_{0} can be expressed as:
If we make frequency domain sampling for the above expression, we can get its discrete Fourier transform expression:
In the expression Eq. 15, Δf = f_{s}/N is the
sampling interval of frequency domain and N is the length of being truncated
data. It’s hard for peak frequency Δf_{0} = k_{0}f
to coincide with discrete spectral line frequency, which means that generally
speaking, k_{0 }is not an integral number and the two spectrum lines
near to k_{0} should be the biggest or second biggest amplitude spectrum
line neighboring the peak point. The spectrum lines in the two sides of peak
point are separately k_{1 }and k_{2}, both of which should also
be the biggest and second biggest spectrum line neighboring peak. Obviously,
k_{1}≤k_{0}≤k_{2} = k_{1}+1, which makes
the two spectrum line amplitude, respectively be y_{1} = X(k_{1}Δf)
and y_{2} = X(k_{2}Δf). From expression Eq.
15, we can know that:
Suppose the window function is given, we can deduce the unknown k_{0} from expression 16 and then the modified peak frequency. Finally, we can get the phase modifier formula:
In the expression above,
is the argument of complex number and the value of i is 1or 2. As 0≤k_{0}1≤1,
we can introduce an auxiliary parameter a = k_{0}k_{1}0.5.
Apparently, the number range of a is [0.5, 0.5]. Through the method of polynomial
approximation, we can get the corresponding modifier formula of different window
functions. The used modifier formulas refer to literature (Hui
and Yang, 2010).
SIMULATION VERIFICATION AND COMPARATIVE ANALYSIS
Harmonic detection: The methodology of applying addwindow to detect
harmonic wave in this paper goes like this: firstly, we sample net voltage or
current signal and transform it into discrete series via FFT; then establish
data window and ignore the signal wave form of data window before and after;
finally, we can successively get the detected harmonic signal by adopting Hanning
window low pass filter (Huang et al., 2011).
When doing the above steps, the sampling principle should be satisfied to avoid the overlapping of frequency spectrum. In the second place, the sampling frequency must be synchronized with the signal frequency and sample the whole period.
In order to verify the feasibility and superiority of the algorithm adopted in this study, we simulate the harmonic analysis of nine harmonic signals in MATLAB. Presume the voltage waveform of small hydro, when synchronizing, as the following formula:
Suppose the fundamental frequency of grid harmonic signal to be 50 Hz, the
sampling frequency f_{s} to be 6.4 kHz and the data length of the truncated
signal to be 1024 points. The amplitude of fundamental wave and each harmonic
and the phase set value are as presented in Table 1. The wave
form after sampling is shown in Fig. 2.
Simulation process: Firstly, we sample the signals with the sampling
frequency of 128*50 Hz. Sample 16 periods and compare it with the functions
without adding windows or adding different window (Hamming window, Hanning window
or Blackman window) in the respect of measuring accuracy. We calculate the detected
amplitude of each harmonic when adding different window functions and compare
those detected data with each initial given harmonic amplitude, which is shown
in Table 2. We can see from Table 2 that
the frequency and the amplitude of each harmonic differ most greatly from real
value via noadding window FFT operation. The amplitude gotten from Hanning
window interpolation operation is the closest to real value among the several
addingwindow interpolation algorithms.

Fig. 2: 
Signal chart with 9 harmonic data 
Table 1: 
Amplitude and phase of each harmonic 

Table 2: 
Calculated results comparison of modifying algorithm by adding
no window and adding different windows 

The amplitude of each harmonic getting from ordinary FFT algorithm is bigger
than that from addingwindow FFT algorithm, which means that its detected accuracy
is inferior to the detected result of addingwindow algorithm. Addingwindow
FFT can detect harmonic more accurately than ordinary FFT, while adding Hanning
window can better improve the accuracy of harmonic analysis and its calculated
frequency and amplitude are relatively accurate and its effect is optimal.
In order to prove the highest amplitude recognizing accuracy of Hanning window more sufficiently and more intuitively, the curve graph of amplitude absolute error under three window functions is illustrated in Fig. 3. From this figure we can easily see that when adopting Hanning window to modify, the amplitude error curve is the gentlest. To sum up, we can prove adequately that the feasibility and superiority of adopting hanning window to modify detected harmonic in this study.
Figure 4 is the signal frequency spectrogram of the original signal after adding Hanning window. There are fundamental wave and harmonic component in this frequency spectrogram. From the figure we can see that the amplitude of each sampling point is irregular. The error brought about by frequency spectrum leakage and picket fence effect is decreased after adopting adding window interpolation algorithm.
Interharmonic detection: Steps of detecting interharmonic: (1) Adding window for the original signal x[k]. We choose adding Hanning window to avoid the effect of interharmoinc main lobe on harmonic frequency point, (2) Processing the afteraddingwindow signal with TDA and period prolongation to get more accurate signal x’[k] and (3) Finally, modify the interpolation x’[k] and get interharmonic frequency spectrum parameter.
Suppose the interharmonic model as:
In Eq. 19, x(t) is original signal, f_{m}, A_{m},
φ_{m }are separately the frequency, amplitude and the initial phase
of the m interharmonic. The frequency value of fundamental wave is 50 Hz, the
sample frequency is 1500 Hz and the sample point is 1024 which is equal to 32
periods. The amplitude and phase value of each interharmonic can be arbitrary
defined. The initial value of interharmonic detection parameter in this paper
is defined as in Table 3. As the biggest frequency spectrum
leakage is the fundamental wave leaking its nearby interharmonic. The amplitude
difference between fundamental wave and its neighboring interharmonic is 50
db.

Fig. 3: 
Absolute error of amplitude 

Fig. 4: 
Frequency spectrum of original signal after adding window 
Table 3: 
Amplitude of interharmonic and the initial value of phase 

If we want to limit the leakage within 0.1%, the amplitude difference should
be at least 100 db. From Eq. 3, we can get that the window
function length of Hanning window when truncating is at least 33 periods. When
the sampling point is 1024, the sampling frequency is 1500 Hz and the period
amount of actual sampling signal reaches about 40, it would satisfy the leakage
limiting requirement.
When the fundamental frequency, the interharmonic frequency, amplitude and
the initial value of phase are determined, the signal is timedomain sampled
again.
Table 4: 
Parameter comparison between ordinary FFT and addwindow
interpolation FFT interharmonic 

Table 5: 
Parameter error of each signal between ordinary FFT and addwindow
interpolation FFT 


Fig. 5: 
Interharmonic signal frequency spectrogram 
Then through addHanning window truncation analysis and interpolating correction,
we can get the parameter values of each interharmonic frequency, amplitude
and phase. Compared to the initial set values, the interpolation FFT detected
values are much closer than the values detected by ordinary FFT. Specific see
Table 4. It is the interharmonic signal frequency spectrogram
detected in Fig. 5.
In order to explain the problem in a further step, we compare the parameter errors of each signal under the circumstances of ordinary FFT and addwindow interpolation FFT, which can be clearly seen from Table 5. We can know from the table that the addwindow interpolation FFT algorithm frequency estimated accuracy can reach 0.002% and the estimated amplitude accuracy is also within 0.1%. Meanwhile, the phase estimated accuracy is controlled within 5%. In conclusion, addwindow interpolation FFT algorithm is superior to ordinary FFT algorithm.
CONCLUSION
The harmonic and interharmonic detection and its accuracy estimation caused
by small hydro synchronization is very significant for the safe operation of
power grid. In this paper, after choosing proper window function, transform
the sampled signals by using addwindow FFT; then correct the analyzed results
by using interpolation algorithm. All of these can reduce leakage and noise
interference effectively and improve the accuracy of harmonic and interharmonic
analysis. This kind of algorithm can be planted conveniently in power systematic
monitor equipment which is based on micro processor, so that the accurate measurement
of harmonic and interharmonic caused by small hydro synchronization can be
realized. The experiment results also testified the effectiveness and easy feasibility
of addwindow interpolation algorithm.