Professional Documents
Culture Documents
Discrete Fourier Transform
Discrete Fourier Transform
Motivation:
Consider a finite duration signal
) (t g
of duration T sampled at a uniform rate s
t
such that
s
Nt T
where N is an integer > N
Then the Fourier transform of signal is given !"
T
ft j
dt e t g f G
#
) ( ) (
$f we now evaluate the a!ove integral !" trape%oidal rule of integration after padding
two %eros at the e&tremit" on either side 'signal is %ero there infact() we o!tain the
following e&pressions*
#
) ( ) (
N
n
fnt j
s s
s
e nt g t f G
(+)
The inverse DFT ($DFT) which is used to reconstruct
the signal is given !":
df e f G t g
ft j #
) ( ) (
(#)
$f) from equation (+) we could compute complete frequenc" spectrum i*e*
f f G )) (
then (#) would impl" that we can o!tain
T t t g ) (
* The
fallac" in the a!ove statement is quite o!vious as we have onl" finite samples and the
curve connecting an" #,samples can !e defined plausi!l" in infinitel" man" wa"s (see fig
(#))* This suggests that from (+)) we should !e a!le to derive onl" limited amount of
frequenc" domain information*
Since) we have -,data points 'real( and
) ( f G
a comple& num!er contains !oth
magnitude and phase angle information in the frequenc" domain (#,units of information))
it is reasona!le to e&pect that we should !e in a position to predict atmost
#
N
independent transforms
) ( f G
for original signal*
-ow) let
N
f
Nt T
f
s
s
+ +
and
N
mf
Nt
m
mf f
s
s
(.)
then su!stituting (.) in (+)) we get
#
) ( ) (
N
n
nt
Nt
m
j
s s
s
s
s
e nt g t
N
mf
G
#
) (
N
n
N
mn j
s s
e nt g t
Fig (+)
., different fits to the curve
Fig (#)
-ote that our choice of frequenc" f
#
) ( ) (
N
n
N
mn j
e n x m X
(1)
2ur ne&t 3o! should !e to come up with inverse transformation* 4ssuming for -,samples
+ +
* )********* )
N
x x x
that (1) would !e a transformation and if (#) defines $FT in
continuous domain) in the discrete domain) we can h"pothesi%e following inverse
transform*
#
) (
+
) (
N
m
N
mn j
e m X
K
n x
(5)
6here 7 is a suita!le scaling factor*
2ur ne&t 3o! is to verif" that (1) and (5) indeed define a transformation pair
Su!stituting (1) in (5)) we get following e&pression for right hand side of (5)
Right hand side
N
mn j
N
m
N
k
N
mk j
e e k x
K
#
+
#
) (
+
1
]
1
(8)
'-ote the use of dumm" su!script k (
9et us wor: this e&pression out in a long hand fashion; for compactness we use notation
) (n x x
n
1
1
1
1
1
1
]
1
+ + + +
+ +
+ + + +
+ + +
+
+
+
) + ( # ) + ( #
+
) + ( # ) + ( #
+
) + ( #
# ) + ( #
+
# #
+
#
+ +
#
N m e e x e e x e x
m e e x e e x e x
m x x x
K
RHS
N
n N j
N
N j
N
N
n N j
N
N j
N
n N j
N
n j
N
N j
N
N
n j
N
j
N
n j
N
$n the a!ove e&pression) for the first row
m
is set to %ero) for the second row it is set to
one and for the last row + N m
-ow) grouping terms column wise) we get
1
1
1
]
1
+ + + +
+ + + + + + +
) + (
) + ( ) + (
+
) + (
) + ( #
) + (
#
+
) + )( + ( # ) + ( #
+
) + ( # #
N n
N
N j
N n
N
j
N
N
n N j
N
n j
N
n N j
N
n j
e e x
e e x e e x
K
RHS
) (
#
+
N
k
N
m
k n
N
m j
k
e x
K
-ote that this 3uggler" shows that we can interchange the summation order* 2ne order
indicates row wise and another column wise summation
i*e*
) (
#
+
N
k
N
m
k n
N
m j
k
e x
K
RHS
(<)
2ur primar" tas: now is to evaluate the e&pression*
) (
#
N
m
k n
N
m j
e
6e now claim that
;
;
) (
#
n k if
n k if N
e
N
m
m k n
N
j
Proof: - for n k
m e e
m j
m k n
N
j
+
* *
) (
#
=ence) the first case is o!vious*
-ow) if n k ) let
+
k n k
) + )( (
#
+ ) (
#
) (
#
+
) (
#
+ + +
N k n
N
j
k n
N
j
k n
N
j
N
m
k n
N
m j
e e e e
-ow)
( )
m
k
m
k
N
j
m k
N
j
a e e
+
+ + # #
,
_
where
N
j
e a
#
+
+
+
+
+
+
+
+
+
#
#
#
#
+
#
+
) (
#
,
_
+ +
,
_
k
N
j
k j
k
N
j
N k
N
j
N
m
m
k
N
j
N
m
k n
N
m j
e
e
e
e
e e
if
+
k is integer) then
+
+
#
k j
e
-ote that we have used the following geometric series e&pression
r
r a
ar ar a
n
n
+ + +
+
) + (
********
+
Thus) R=S in (8) is equal to
n
x
K
N
6e see that equation (8) defines the inverse transformation if we choose N K ;
Thus) -,point DFT and $DFT for samples
[ ]
+ +
)***** )
N
x x x
are defined as follows*
N
mn j
N
m
N
n
N
nm j
n
e m X
N
n x
e x m X
#
+
#
) (
+
) (
) (
-ote that in general DFT and inverse DFT can !e defined in man" wa"s) each onl"
differing in choice of constant
+
C and
#
C
DFT $DFT
i*e*
#
+
) (
N
n
N
nm j
n
e x C m X
#
#
) (
N
m
N
nm j
n
e m X C x
The constraint in choosing the constants is that product
N
C C
+
# +
For >&le) when
N
C C
+
) +
# +
#
+ #
# +
C
N
C
N
C
N
C
+ +
# +
Choice of
N
C
#
+
is commonl" used in rela"ing !ecause it simplifies phasor estimation*
?hasor estimation will !e discussed later*
6e now discuss some important properties of DFT*
$mportant ?roperties of DFT
(+) 9inearit": 9et
{ }
+ +
)****** )
N
x x x
and
{ }
+ +
)****** )
N
y y y
!e two sets of
discrete samples with corresponding DFT0s given !"
) (m X
and
) (m Y
* Then
DFT of sample set
{ }
+ + + +
**) )********* )
+ + +
N N
y x y x y x
is given !"
) ( ) ( m Y m X +
Proof:
#
) (
N
n
N
nm j
n
e x m X
;
#
) (
N
n
N
nm j
n
e y m Y
+ +
+
#
) ( ) ( ) (
N
n
N
mn j
n n
e y x m Y m X
(#) ?eriodicit" : 6e have evaluated DFT at
+ )********) + ) N m
* Thereafter)
) ( N n
it shows periodicit"* For e&le
) ( ) # ( ) ( ) # ( ) ( ) ( m kN X m N X m N X m N X m N X m X + + + + +
6here k is an integer
Proof:
+
+
) (
#
) (
N
n
m kN
N
n j
n
e x m kN X
#
#
N
n
kn j
N
nm j
n
e e x
(@)
Aoth k and
n
are integers* =ence +
#
kn j
e
; Therefore from (@) we set
) ( ) (
+
#
m X e x m kN x
N
n
N
nm j
n
+
(.) DFT s"mmetr": $f the samples n
x
are real; then the" contain atmost N !its
of information* 2n the otherhand)
) (m X
is a comple& num!er and hence contains
# !its of information* Thus) from sequence
{ }
+ +
)*****) )
N
x x x
) if we derive
{ } ) + ( ))*******) + ( )) ( N X X X ) it implies that from -,!it of information) we are
deriving N # !its of information* This is counter intuitive* 6e should e&pect some
relationship in the sequence
{ } ) + ( ))*******) + ( )) ( N X X X
* There is some
redundanc" in computation of
) + ( **** )********* ( N X X
* 4s per DFT s"mmetr"
propert") following relationship holds*
) ( ) (
B
m X m N X
+ )*****) + ) N m
6here B indicates
comple&
con3ugate operation
Proof:
#
) (
N
n
N
nm j
n
e x m X
) (
#
) (
N
n
m N
N
n j
n
e x m N X
C
n j
N
n
N
nm j
n
e e x
#
+
Since N n e
n j
+
#
it follows that
#
) (
N
n
N
nm j
n
e x m N X
B
#
) (
N
n
N
nm j
n
e x
B
+
#
1
]
1
N
n
N
nm j
n
e x
B
) (m X
Thus) we conclude that
) ( ) ( m X m N X
'S"mmetr"(
and
) ( ) ( m X m N X
'4nti,s"mmetr"(
Thus) a t"pical DFT magnitude and phase plots appear as follows*
DFT phase shifting:,
DFT shifting propert" states that) for a periodic sequence with periodicit" - i*e*
) ( ) ( lN m x m x +
) l an integer) an offset in sequence manifests itself as a phase shift
in the frequenc" domain* $n other words) if we decide to sample &(n) starting at n equal to
some integer 7) as opposed to nC) the DFT of those time shifted samples*
) (m X
sifted
) ( ) (
#
shifted
m X e m X
N
km j
Proof: A" periodicit" of samples) we have
) ( ) ( x N x
) + ( ) + ( x N x +
) + ( ) + ( + K x K N x
#
) (
N
n
m
N
n j
n
e x m X
+
+
#
+
#
N
K n
N
nm j
n
K
n
N
nm j
n
e x e x
Starting DFT with sa" this sample will lead to offset of #
Fig (.) Fig (1)
Fig (5)
+
+
+
#
+
#
N
K n
N
nm j
n
K
n
N
nm j
n N
e x e x
1
]
1
+
+
+
#
+
#
+
) ( #
N
N
m j
N
K n
N
nm j
n
K
n
N
n N m j
N n
e e x e x
+
+
#
+
#
N
K n
N
nm j
n
K N
N n
N
nm j
n
e x e x
+
#
) (
K N
K n
m
N
n j
n
e x m X
(@)
-ow to compute sifted
X
) let us map the samples + +
)********) )
+ + K N K K
x x x
to
+ +
*********) )
N
y y y
*
4ppl" DFT to sequence
y
#
) (
N
n
N
nm j
n sifted
e y m X
#
N
n
m
N
n j
n K
e x
) (
# #
N
n
K n
N
m j
n K
N
mK j
e x e
+
# #
K N
K n
N
N
n j
n
N
nK j
e x e
) (
#
m X e
n
N
nK j
(from (@))
Computation of ?hasor from DFT:
Consider a sinusoidal input signal of frequenc"
) given !"
) sin( # ) (
+ t X t x (D)
This signal is convenientl" represented !" a phasor X
) sin (cos
j X Xe X
j
+ (+)
4ssuming that
( ) t x
is sampled N times per c"cle s*t
s
Nt
5
+
of the 5=% waveform
to produce the sample set E
k
x
F) Then)
)
#
sin( #
+ k
N
X x
k
(++)
=ence) 4n integer m) in the transform domain corresponds to frequenc" mF
* Thus)
choice mC+ corresponds to e&tract the fundamental frequenc" component* The discrete
Fourier Transform of k
x
contains a fundamental frequenc" component given !"
#
+
#
N
k
k
N
j
k
e x
N
X
(+#)
)
#
sin(
#
)
#
cos(
#
N
k
N
k
k k
k
N
x
N
j k
N
x
N
s !
jX X
(+.)
where
)
#
cos(
#
N
k
k !
k
N
x
N
X
(+1)
)
#
sin(
#
N
k
k s
k
N
x
N
X
(+5)
Su!stituting for k
x
from (++) in (+#) and (+.) it can !e shown that for a sinusoidal input
signal given !" (D)
cos # sin # X X X X
s !
(+8)
From equation (+)) (+.) and (+1) it follows that
( )
! s
jX X jX X +
#
+
#
+
+ (+<)
6hen the input signal contains other frequenc" components as well) the phasor
calculated !" equation (+<) is a filtered fundamental frequenc" phasor* $t is presumed
here that the input signal must !e !and,limited to satisf" the G-"quist CriterionH) to avoid
errors due to aliasing affects*
>ffect on phasor computation
$n rela"ing applications during stead" state we will !e wor:ing with moving
window) such that each window having most recent -,samples* ) + (
) + ( ) + (
+
K K
X X
) + ( ) + (
+
#
K
N
j
K
X e X
N
X X
K K
#
+
i*e* DFT rotates at a speed
N
#
per sample*
) + (
#
"#T
jX
N
X
This suggests that
N
j
K
e jX
N
K X
#
+
) + (
#
) (
+
#
) (
6here
+
#
cos ) (
$ N
$ n
n
$
!
N
nm
X m X
(D)
+
#
sin ) (
$ N
$ n
n
$
s
N
nm
X m X
(+)
%xam&le: let
) sin( t x
6ith sampling rate of -,samples per c"cle we have
N
T
t
s
;
)
#
sin( )
#
sin(
N
n
N
T
n
T
x
n
Su!stituting n
x
in equation (D)) we get
+
#
cos
#
sin #
#
+
$ N
$ n
$
!
N
nm
N
n
X
1
]
1
+ +
+
)) + (
#
sin( )) + (
#
sin(
#
+
$ N
$ n
m
N
n
m
N
n
+
#
sin
#
sin #
#
+
$ N
$ n
$
s
N
nm
N
n
X
1
]
1
+ +
+
)) + (
#
cos( )) + (
#
cos(
#
+
$ N
$ n
m
N
n
m
N
n