Fast Fourier Transform
Fast Fourier Transform
Fast Fourier Transform
X ( m) x n e
j 2 nm
N
n 0
j 2
N
th
Let a e , the N root of unit. Then the following relationships can be easily
derived.
1) 1 a a 2 a N 1 0
Proof: using Geometric progression series formula
x xr xr xr
2
We 1 a a a
2
N 1
N 1
x(1 r N )
(1 r )
1(1 a N ) (1 1)
0 because a N 1
(1 a )
(1 a )
(a m ) * a N m
Hence a * a N 1 , (a 2 ) * a N 2 etc.
3) From the fact a 1 a 1 and a * a 1 , we have
2
* 2
N 2
etc.
a 1 a * a N 1 and a (a ) a
X (0) x0 x1 x N 1
X (1) x 0 x1 a 1 x N 1 (a 1 ) N 1
X ( N 1) x 0 x1 a ( N 1) x N 1 (a 1 ) ( N 1)
Arranging it in a matrix format, we get the following
X (0)
X (1)
1
1
1
a 1
X ( N 1)
1 (a 1 ) N 1
x0
(a 1 ) N 1 x1
|
1 ( N 1) 2
(a )
x N 1
1
(A)
X P x
Where P (i, j ) ( a 1 ) (i 1) ( j 1)
The i th row of the matrix P indexes the i th frequency component while the j th
column of the P matrix indexes the j th sample. The matrix P enjoys a very
special property viz. its columns or rows are orthogonal to each other. If pi and p j
denote the i th and j th column of matrix P , then, it is easy to verify that
piH p j 0
(i j )
piH pi N
Where H- indicates Hermitian operator defined as
piH ( p iT ) * ( p i* ) T
i.e. each column is first transposed to a row and every element is then replaced by its
complex conjugate.
For a real number, the complex conjugate is identical to the original number. Hence
on real-valued vectors, Hermitian and transpose operators are one and the same.
However, for complex valued vectors the two differ.
It is now easy to verify that
P 1
1 H
P
N
1
1
N 1
H
and P
1 a ( N 1)
2 ( N 1)
( N 1) 2
Thus
X P x
(1)
(2)
1 H
P X
N
N
log 2 N computations. This fast approach to computing all possible
2
frequency transforms in discrete domain is called Fast Fourier Transform (FFT). For
example, with N 8 brute force implementation of (1) requires 64 complex
multiplications which can be reduced to 12 multiplications with FFT. As we would
not have much use for FFT in this course, we will not pursue this topic any further.
Rather, we now establish an equivalence between two very well known transforms
viz. multiple DFT (or) FFT and sequence component transformation. [for the
remaining text through out we will refer equation (1) as FFT]
x1 x 2 x N
X0
N
(A1)
There are n- such phasors in 1-sequence system. If X 1,1 is taken as reference, then
X 1,2 is equal in magnitude to x 1 ( a ) but **** by angle
2
N 1
i.e. X 1,2 X 1,1a
N
x1 x 2 a 2 x 3 a 4 x N (a 2 ) N 1
N
(A2)
x 1 x 2 (a 2 ) N 1 x 3 (a 4 ) N 1 x N a ( N 1)
(3)
Figure 1(a, b and c) visualize the system for a 3-phase system. Expressing these
equations in matrix format we obtain the following equations.
1
X0
1
X
1
a
1
1
| 1 a2
N
|
|
|
X N 1
1 a ( N 1)
x1
a N 1 x 2
a 2 ( N 1) |
( N 1) 2
a
xN
1
a2
a4
a 2 ( N 1)
X P 1 x
or
x P X
(B)
Where X X 0 , X 1 ,....., X N 1
x x1 , x 2 ,....., x N
Thus, from (1) and (B) we conclude that FFT and sequence transformation (defined
from sequence domain to the phase domain) involve the same transformation matrix
P. Hence, the two transforms are mathematically equivalent. In particular for N=3.
With a- phase as reference phasor, we see the following equivalence relationships.
Va 1 1
V 1 a2
b
Vc 1 a
1
a
V0
V
1
a 2 V2
V ( 0) 1 1
V (1) 1 a 2
V (2) 1 a
1 Va
a Vb
a 2 Vc
x(t ) e
j 2 k f 0 t
xn e
j 2 nP
N
(n 0)
X (m) xn e
j 2 n m
N
n0
The mathematical equivalence of two should put the reader at ease with both these transformations,
irrespective of which one he came across first.
N 1
j 2 n
( Pm)
N
---------- (3)
n0
------- (4)
N 1
n
N 1
Then X (m) q 1 q q
---------- (5)
n0
1 q N 1 e j 2 ( P m )
=
2
j
( P m)
1 q
1 e N
e j ( P m )
e
e j ( P m ) e j ( P m)
( P m )
N
( P m)
N
j ( P m )(1
1
)
N
j ( P m )(1
N e
1
)
N
1
)
N
( P m )
N
e j ( P m ) e j ( P m)
e
j ( P m )(1
( Pm)
N
2j
( P m )
N
2j
sin ( P m)
sin ( P m)
N
sinc( ( P m)) ( P m)
sinc( ( P m)) ( P m)
N
N
j ( P m )(1
1
)
N
sinc ( P m)
sinc( P m)
N
sin( x )
Note that MATLAB defines sin c( x)
x . So this definition is at variance
with our definition viz. sin c( x) sin( x ) x . While programming in MATLAB one
must carefully account for it.
Fig (1)
Fig (3)
Fig (2)
Fig (3)
Finally, Fig (3) shows a set of response when frequency deviation from nominal is
large enough i.e. f = 40, 50, 60 Hz. It can now be seen easily that if we sample the
envelope of 40Hz signal at 50 Hz ( m 1 ), a finite non-zero value different from unity
is returned. This effect is knows as DFT leakage. It is said that the energy in
frequency bin f 40 Hz has leaked into frequency bin f 50 Hz . Though, in DSP
literature, DFT leakage is considered to be undesirable from the relaying perspective,
it turns out to be a boon in disguise.
As seen in fig (3), the DFT magnitude leakage for 1 Hz frequency deviation around
nominal frequency say 50Hz, is practically negligible. For f = 51 Hz, it equals
51
sin c ( ( 50 1))
1 pu = -0.0065. This indicates that magnitude of phasor
sin c ( ( 50 1))
50
51
1
and N 12 X (m) ( P m)(1 )
50
N
Thus X (1)
180 0
1
180 11
(51 50)(1 )
3.3 0
50
12
50 12
e j 2 f t e j 2 f t
and by following similar steps as in the case of
x (t ) cos 2 f t
2
complex exponential, we get x(n)
1 j
e
2
2 n P
N
2 n P
N
Thus
1 N 1 j 2N n ( P m ) j 2N n ( P m )
X (m) e
e
2 n 0
2 n
( P m)
N
Ne
j ( P m )(1
1
)
N
n 0
sinc ( P m)
sinc
( P m)
N
Ne
j ( P m ) ( P m )
N
n 0
sinc ( P m)
sinc ( P m)
N
Thus,
X c ( m)
while,
and
conclude that even with real sine or cosine signal, any reasonable deviation of the
signal from the nominal value, leads to negligible magnitude leakage. However,
phase angle error for 1Hz deviation in frequency is approximately 3.3 which is not
negligible.
Figure shows the envelope of magnitude response of X c (m) for different frequencies
40, 50, 60 Hz.
f s T0
th
f 0 m P1 P 1 w
Estimation of Frequency
Our aim, now, is to develop a method of estimating power system frequency using the
recursive DFT approach to phasor estimation. We plan to show that in the moving
window approach; the phase angle estimated by recursive DFT approach rotates at a
speed proportional to the deviation from the nominal frequency. In turn, this deviation
can be assessed by measuring the rate of change of phase angle. In the previous
section, we have derived the DFT leakage for complex exponential and real cosine
signals. We will now generalize the DFT computation of complex exponential so that
it can handle moving window concept.
Generalized DFT of Complex Exponential
Following the methodology used while generalizing DFT, we can write generalized
DFT, we can write generalized DFT for wth window (window no. corresponds to the
sample no. of first sample in the window) as:
X w (m)
N w 1
n w
where x e
n
xn e
j 2 n
m
N
--------(9)
j 2 nP
N
N w 1
j 2 n
( Pm)
N
n w
j 2
( Pm) w
N
[1 q .... q N 1 ]
where q e
j 2
( Pm)
N
N 1
Summation
i 0
we obtain X w (m) e
j 2 n
( P m ) w
N
X c (m)
---------- (10)
j 2 n
( P m )
1 N w1 j 2N n ( P m )
N
e
2 n w
--------- (11)
1 j 2N w ( P m ) N 1 j 2N n ( P m ) 1 j N2 w ( P m ) N 1 jN2 n ( P m )
e
e
e
e
2
2
n 0
n 0
1
N j 2N w ( P m ) j ( P m ) 1 N sin c P m
N j N2 w ( P m ) j ( P m ) 1 N sin c P m
e
e
e
e
2
2
P m
sin c
P m
sin c
(12)
Following the similar reasoning as outlined in the previous section of the DFT of real
cosine signal, we can neglect the second term in (12). This leads to following
approximation.
N j 2N w ( P m ) j ( P m ) 1 N sin c P m
X (m) e
e
2
sin c
P m
N
----------- (13)
j 2 w
( P m )
N
= 1. However,
when frequency deviates from nominal frequency i.e P 1 , then X w (1) , the DFT
estimate for nominal frequency, will start rotating along with the window. From, (13)
j 2
( P 1)
X w1 (1)
N
e
we can derive that
w
X (1)
e
e
w
N 2
X
w
j 2 f f 0
N
f0
j 2 T0
N
w 1
e j 2 f t
----------- (14)
2f
dt
t
Discussion:
There are many advantages associated with the above algorithm. The method is not
based on zero crossing times and it is immune to noise and harmonics. Instead of
using single phase quartiles, one can estimate the +ve sequence component and derive
frequency from it. Such an approach will use all the three phase voltages and hence
will have better noise rejection properties. At harmonic of nominal frequency
X w (m) 0 and hence, the above approach will reject frequencies m f 0 completely.
Measurement of Frequency
f 0 accuracy measure frequency we integrate eqn. (15) until, a change equal to
approx. 0.5 radians is accumulate this change is T, then
f
0.5
2 T
0.32
sec
f