You are on page 1of 5

# Optimal interpolating windowed discrete Fourier

## transform algorithms for harmonic analysis in

power systems
H. Xue and R. Yang

Abstract: An interpolating windowed discrete Fourier transform (DFT) has been used to eliminate
the errors caused by the leakage and picket fence effects associated with use of a conventional
DFT. An interpolating algorithm eliminates the errors caused by the picket fence effect, and the
errors produced by the leakage effect are reduced by windowing the signals. The precision of the
harmonic analysis and the implementation of the interpolating algorithm are both affected by
the choice of window function. The leakage effect of a conventional DFT and the windowed DFT
are analysed. A method to construct optimal window functions and the corresponding
interpolation algorithms is presented. Simulation results show that the interpolating windowed
DFT algorithms have a high accuracy and are easy to implement and they are therefore useful
tools for precise and practical harmonics evaluation in power systems.

## 1 Introduction leakage effect . Also, the implementation of an

interpolating algorithm is affected by the window function,
The increasing use of nonlinear harmonic components in in fact, an inappropriate selection of the window function
power systems has lead to the problem of interference would make the corresponding interpolating algorithm
between the harmonics. These harmonics include not complex and therefore difcult to implement . There-
only integer harmonics, which have a frequency that is an fore, the choice of an appropriate window function is a
integer multiple of the fundamental frequency, but also prerequisite for a high precision interpolating windowed
non-integer harmonics, or interharmonics , which have a algorithm.
frequency that is not an integer multiple of the fundamental
frequency. The existence of these harmonics deteriorates the
safe and economic operation of an electric power system 2 The leakage effect of the DFT
. Therefore, it is necessary to analyse the harmonic
contents and control the status of harmonics in an electrical For a signal x(t) with a limited duration of T and consisting
network. of a single frequency of m/T, the conventional DFT, or
The harmonic analysis of a power system is generally the discrete spectrum of the signal can be expressed as
effected by using discrete Fourier transform (DFT) follows  :
techniques. . However, because of the picket fence and sinn  mp jy jnmp
leakage effects created by the use of a DFT, the results are X n AN e e 1
not precise and the technique cannot be used if there are n  m2p
non-integer harmonics present in the system. To improve where A and y are the amplitude and phase of the sampled
the precision of the DFT algorithm, the interpolating harmonic and n is the order of the spectral line in the
windowed algorithm was proposed, in which the errors frequency domain. If m in (1) is an integer, then (1) can be
caused by picket fence effects are eliminated by the simplied to:
interpolating algorithm, and the errors created by leakage (
X n  AN2 e
jy
nm
effects are reduced by windowing the signals [5, 6]. Many 2
window functions have been proposed , including X n 0 n6 m
the Hannings window, the Hammings window and
Equation (2) shows that if m is an integer, that is, if the
the Blackmans window. The performance of a windowed
sampled harmonic is an integer harmonic, the discrete
DFT is affected by the window function. It has been
spectrum is a single line whose frequency, amplitude and
shown that a narrow central lobe in a windows spectrum
phase can be obtained through (2). Therefore, a precise
relates to a good frequency resolving power whilst a
measurement for integer harmonics can be obtained
low amplitude for the side lobes is indicative of a small
through use of a conventional DFT algorithm. However,
if m is not an integer, that is, if the sampled harmonic is a
r IEE, 2003 non-integer harmonic, or an interharmonic, the discrete
IEE Proceedings online no. 20030740 spectrum will be more complex. Assume that m m1+r
doi:10.1049/ip-gtd:20030740 (where m1 is an integer, and 0oro1), then (1) can be
Paper rst received 6th November 2002 and in revised form 27th May 2003. simplied to:
Online publishing date: 13 August 2003 sinn  m1 p  rp jy jnm1 pjrp
The authors are with the Information and Electrical Engineering Department, X n AN e e 3
China Agriculture University, Beijing 100083, Peoples Republic of China 2n  m1 p  rp

IEE Proc.-Gener. Transm. Distrib., Vol. 150, No. 5, September 2003 583
Equation (3) can be simplied to: expressed as:

M M X
1
ai
X n t n  m1  r XHanningK1 n 1kX0 n  i X0 n i
n  m1  r t i0
2
4  
AN sinrpejyrp 0:5 0:5t M=2
M M  2 2
2p t t 1 tt  1
Equation (4) shows that M is a constant for a certain non- 9
integer harmonic, and the discrete spectrum of the non-
integer harmonic is not concentrated on a single spectral X
1
ai
XHammingK1 n 1i
X0 n  i X0 n i
line, but is distributed over the whole frequency domain. 2
i0
The two spectral lines that have the maximum amplitude  
would be obtained at n m1 and n m1+1, and have the 0:54 0:46t 0:08t2  1
M  2 M
increased value of 7nm1r7. The amplitude of the t t 1 tt2  1
corresponding spectral lines decreases at a speed of 1/ 10
7nm1r7, or 1/7t7, that is, the spectrum of the non-integer
harmonic leaks to all the spectral lines. This is the leakage X
2
ai
effect of the conventional DFT algorithm. The leakage XBlackmanK2 n 1iX0 n  i X0 n i
effect leads to interference of different harmonics in the i0
2
frequency domain, which leads to errors in the harmonic  
0:42 0:50t 0:08t
analysis. M  2
t t  1 t2  4
11
3 The leakage effect of the windowed DFT
The logarithmic amplitude curves of the 7Xwindow(n)7 are
The errors produced by the leakage effect can be reduced by given in Fig. 1. Compared to a conventional DFT, the
windowing the signals. The most commonly used window amplitude of a 7Xwindow(n)7 (K40) decays faster than the
function is the cosine window. The general expression for amplitude of 7X(n)7, which means that the leakage
the cosine window oK(n) is : components of a windowed DFT (K40) decay faster,
  and the errors caused by the leakage effect would be
X
K
i 2pi reduced. This is why a windowed DFT has a higher
oK n 1 ai cos n 5 precision in harmonic, analyses.
i0
N
The leakage effect can also be analysed through the
spectra of the window functions. The spectra of selected
The values of K and ai determine the various window
window functions are shown in Fig. 2. As previously
functions. For example, if K 0, we have a rectangular
mentioned a low amplitude for the side lobes is associated
window; if K 1, a0 0.54, a1 0.46, we have a Ham-
with a small leakage effects and a narrow central lobe is
mings window; if k 1, a0 a1 0.5, we have a Hannings
associated with a good frequency resolving power for the
window; if K 2, a0 0.42, a1 0.5, a2 0.08, we have a
algorithm. It is clear that the performance of the window
Blackmans window.
functions obtained from Fig. 2 is consistent with the
The key feature of a cosine window that can be described
analysis result obtained through the expression of 7Xwindow
by (5) is that its DFT expression is very simple and can be
(n)7 and Fig. 1.
expressed as:

X
K
ai
WK n 1i Dn  i Dn i 6 0
i0
2

## where D(n) is the Dirichlet kernel, or the DFT of a 5

rectangular window. D(n) can be expressed as: (I)

(II)
sinpn
Dn ejpnN 1=N 10
log (amplitude)

7
N sinpn=N

## where N represents the sample points of the window

15
function. The conventional DFT can be viewed as a
windowed DFT with a rectangular window. Assume that
the conventional DFT of a non-integer harmonic is x(n)
then the windowed DFT, in which the window function has 20 (III)
the form of (5), can be expressed by: (IV)

X
K
ai 25
XK n 1i X n  i X n i 8 0 500 1000 1500 2000
i0
2 t(t=n-k1-r)

## Fig. 1 Log (amplitude) of 7XK(n)7 of windowed DFT

From (8), the windowed DFT, for the non-integer (i) Rectangular window
harmonics for the cases where the window function (ii) Hammings window
is either a Hannings window (K 1), a Hammings (iii) Hannings window
window (K 1) or a Blackmans window (K 2) can be (iv) Blackmans window

584 IEE Proc.-Gener. Transm. Distrib., Vol. 150, No. 5, September 2003
0 0 Using the same reasoning other optimal window functions
log (amplitude), dB

log (amplitude), dB
(K43) can also be obtained.
100 100
The logarithmic spectra of a Hannings window, a
200 200 Blackmans window and the optimal cosine window (K 2)
are shown in Fig. 3. Figure 3 also shows that an increase of
300
0 100 200 300 400 500
300
0 100 200 300 400 500
K results in a faster decay rate for 7XK(n)7. This means that
frequency frequency the leakage effects can be controlled. However, the width of
a b central lobe increases with an increase in K, and so a large
0 value of K is inadvisable. Generally speaking a choice of
log (amplitude), dB

log (amplitude), dB
0
K 1 or 2, allows a satisfactory precision to be obtained for
100 100
the harmonic analysis.
200 200

300 300 0
0 100 200 300 400 500 0 100 200 300 400 500

log (amplitude)
frequency frequency 100
c d
200
Fig. 2 Logarithmic spectra of window functions
a Rectangular window (K 0) 300
0 0.2 0.4 0.6 0.8 1
b Hannings window (K 1)
frequency
c Hammings window (K 1)
d Blackmans window (K 2) a
0

log (amplitude)
100
4 Optimal window functions
200
The window functions are determined by a combination of
300
the K and ai coefcients, where K determines the width 0 0.2 0.4 0.6 0.8 1
of the central lobe and the combination of K and ai frequency
determines the amplitude of the side lobes. For a certain b
value of K, the width of the central lobe is almost the same, 0
log (amplitude)

## while the amplitude of the side lobes is determined by the 100

value of ai. Thus an appropriate value of ai can ensure the
minimum amplitude of the side lobes, which means 200
the smallest leakage effect and also the optimal performance
300
of the windowed DFT algorithm. Any windows having 0 0.2 0.4 0.6 0.8 1
these coefcients will be called optimal cosine windows. The frequency
question arises of how do we choose the optimal cosine c
window functions? Fig. 3 Logarithmic spectra of window functions
When K 0, the best decay rate is equal to 7X00 (n)7 1/ a Hannings window
7t7, which can be obtained from a rectangular window. So b Blackmans window
the rectangular window is the optimal window when K 0. c Optional window (K 2)
When K 1, the decay rate can be expressed as:
ja0  a1 t2 j
jX1 nj 5 Optimal interpolating windowed algorithm
jtt2  1j
and the best decay rate is 7X10 (n)7 1/7t(t21)7, which can The corresponding interpolating algorithms of the optimal
be obtained when a0 a1 0.5, thus is a Hannings window cosine window functions can be easily deduced and they are
and so a Hannings window is the optimal window when labelled the optimal interpolating windowed algorithms.
K 1. Compared to a Hammings window (K 1), it has Assume that the sample duration is T, the frequency,
almost the same central lobe width but the side lobes have a amplitude and phase of the detected signal are (m1+r)/T
lower amplitude. (where m1 is integer, and 0oro1), A and y respectively.
When K 2, the best decay rate is 7X20 (n)7 1/ The optimal interpolating windowed algorithms are pre-
7t(t21)(t24)7, which can be obtained when a0 1/4, sented in the following Sections.
a1 1/3, a2 1/12, therefore the optimal cosine window
function (K 2) can be expressed as: 5.1 The optimal interpolating windowed
   
1 1 2p 1 4p algorithm when K 0
 cos n cos n 12 The optimal window when K 0 is the rectangular window.
4 3 N 12 N
From the expression of x00 (n), it can be easily deduced that
Compared to a Blackmans window (K 3), it has almost two maximum amplitude spectral lines are obtained at
the same central lobe width but the side lobes have a lower n m1, and n m1+1. Assume that the ratio of the
amplitude. amplitudes of the two spectral lines is a, then the value of r
When K 3, the best decay rate is 7X30 (n)7 1/ can be obtained from the function of a as:
7t(t21)(t24)(t29)7, the value of ai can be obtained as:  0   
a0 1, a1 3/2, a2 3/5, a3 1/10; and the optimal  x0 m1   M=r  1  r

a  0   
window function (K 3) can be expressed as:
      x0 m1 1 M=1  r r
14
3 2p 3 4p 1 6p 1
1  cos n cos n  cos n 13 r
2 N 5 N 10 N 1a

IEE Proc.-Gener. Transm. Distrib., Vol. 150, No. 5, September 2003 585
Then the amplitude A and phase y can be obtained from the 2000
expression of x00 (n) as:
   

amplitude
 2pM  2px00 m1 r 1000
A    15
N sinrp  N sinrp 
0
y phasex00 m1  pr 16 0 10 20
frequency
30 40

a
2000

## 5.2 The optimal interpolating windowed

amplitude
algorithm when K 1 1000
Using the same reasoning as above the optimal windowed
interpolating algorithm when K 1 is:
   0
 0 10 20 30 40
 X10 m1   M=rr 2
 1  2r
 frequency
a  0 
  b
X1 m1 1  M=1  r1  r  1 1 r
2
400
2a
r

amplitude
1a 200
17
    0
 2pM  2pX10 m1 r1  r2  0 10 20 30 40
A     18
N sinrp   frequency
N sinrp c

y phaseX10 m1  pr 19 Fig. 4 Discrete spectra obtained from the optimal windowed DFT
a When K 0
b When K 1
c When K 2
5.3 The optimal interpolating windowed
algorithm when K 2
Using the same reasoning as above the optimal windowed Table 1: Results obtained using optimal interpolating
interpolating algorithm when K 2 is: algorithms
 
 X20 m1 

a  0  Optimal Amplitude Frequency Phase(*)
X2 m1 1 algorithms (1/T)
 
 M=rr2  1r2  4 
  Theoretical value 1.3 3.3 45
 
M=1  r1  r2  11  r2  4 K0 1.3321 3.2573 61.3407
3r K1 1.3008 3.3074 43.5176
K2 1.2996 3.2971 45.5418
r2
3  2a Theoretical value 2.5 8.3 72
r 20
1a K0 2.4984 8.2725 79.6329
    K1 2.5013 8.3013 71.7423
 2pM  2pX20 m1 r1  r2 4  r2 
A    21 K2 2.4996 8.3000 71.9997
N sinrp  N sinrp 
Theoretical value 4.5 15.3 60
K0 4.4484 15.3149 58.3750
y phaseX20 k1  pr 22
K1 4.5012 15.3010 59.8092
K2 4.4997 15.2995 60.0978
Theoretical value 1.59 20.4 60
6 Simulation results
K0 1.5603 20.5617 40.9077
Assume that the sample duration is T and that there are 64 K1 1.5946 20.3901 61.6377
sample points then, the sampled signal can be expressed as: K2 1.5888 20.4029 59.5164
   
3:3t 8:3t
st 1:3 cos 45 2:5 cos 72
T T
   
15:3t 20:4t
4:5 cos 60 1:59 cos 60 7 Conclusions
T T
The spectra obtained using the K 1, 2 and 3 optimal The leakage effect of a conventional DFT and the
windows are presented in Fig. 4. The analysis results windowed DFT have been analysed. A method to construct
obtained using the optimal interpolating windowed algo- optimal window functions and the corresponding inter-
rithms are given in Table 1. polating algorithms has been presented. Simulation
Table 1 shows that an increase in K, results in a lowering results show that the algorithms have a high accuracy and
of the leakage effect and thus the harmonic analysis result is are easy to implement and they are therefore useful tools for
more precise. When K 1 or 2, a satisfactory harmonic precise and practical harmonics evaluation in power
analysis result can be obtained. systems.

586 IEE Proc.-Gener. Transm. Distrib., Vol. 150, No. 5, September 2003
8 References 6 Grandke, T.: Interpolation algorithms for discrete Fourier transforms
of weighted signals, IEEE Trans. Instrum. Meas., 1983, 32,
1 Yacamini, R.: Power system harmonics. IV. Interharmonics, Power pp. 350355
Eng. J., 1996, 10, (4), pp. 185193 7 Harris, F.J.: On the use of windows for harmonic analysis with the
2 Nguyen, T.T.: Parametric harmonic analysis of power systems, IEE discrete Fourier transform, Proc. IEEE, 1978, 66, pp. 5183
Proc., Gener., Transm. Distrib., 1997, 144, (1), pp. 2125 8 Heydt, G.T., Fjeld, P.S., Liu, C.C., Pierce, D., Tu, L., and Hensley,
3 Davis, E.J., and Emanuel, A.E.: Harmonic pollution metering: G.: Applications of the Windowed DFT to Electric Power Quality
theoretical considerations, IEEE Trans. Power Deliv., 2000, 1, (15), Assessment, IEEE Trans. Power Deliv., 1999, 14, pp. 14111416
pp. 1923 9 Andria, G., and Savino, M.: Windows and interpolation algorithms
4 Crinon, R.J.: Sinusoid parameter estimation using the fast Fourier to improve electrical evaluatement accuracy, IEEE Trans. Instrum.
transform. Proc. IEEE Int. Sym. on Circuits and systems, 1989, Meas., 1999, 38, pp. 856863
Vol. 2, pp. 10331036 10 Zhang, F., Geng, Z., and Ge, Y.: DFT Algorithm With High
5 Jain, V.K., Collins, W.L., and Davis, D.C.: High-accuracy analog Accuracy for Harmonic Analysis in Power System, IEEE Trans.
measurements via interpolated FFT, IEEE Trans. Instrum. Meas., Power Deliv., 2001, 16, (2), pp. 160164
1979, 28, pp. 179183

IEE Proc.-Gener. Transm. Distrib., Vol. 150, No. 5, September 2003 587