Vous êtes sur la page 1sur 15

Discrete Fourier Transform of

Real Sequence
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
0 > N
Then the Fourier transform of signal is given by

T
ft j
dt e t g f G
0
2
) ( ) (


If we now evaluate the above integral by trapezoidal
rule of integration after padding two zeros at the
extremity on either side [signal is zero there infact], we
obtain the following expressions.

1
0
2
) ( ) (
N
n
fnt j
s s
s
e nt g t f G

(1)
The inverse DFT (IDFT) which is used to reconstruct the signal is given by:
Fig (1)


df e f G t g
ft j 2
) ( ) (
(2)

If, from equation (1) we could compute complete frequency spectrum i.e.
f f G ), (
then (2) would imply that we can obtain
T t t g 0 ) (
. The fallacy
in the above statement is quite obvious as we have only finite samples and the curve
connecting any 2-samples can be defined plausibly in infinitely many ways (see fig (2)).
This suggests that from (1), we should be able to derive only limited amount of frequency
domain information.
Since, we have N-data points [real] and
) ( f G
a complex number contains both
magnitude and phase angle information in the
frequency domain (2-units of information), it is
reasonable to expect that we should be in a
position to predict atmost
2
N
transforms
) ( f G

for original signal.
Now, let
N
f
Nt T
f
s
s

1 1
0
and
N
mf
Nt
m
mf f
s
s

0
(3)
then substituting (3) in (1), we get
Fig (2)
3- different fits to the curve

1
0
2
) ( ) (
N
n
nt
Nt
m
j
s s
s
s
s
e nt g t
N
mf
G


1
0
2
) (
N
n
N
mn j
s s
e nt g t


Note that our choice of frequency is such that the exponential term in (1) is
independent of
s
t
. The intuition for choosing such
f
is that, basically we are attempting
a transform on discrete samples which may (or) may not have a corresponding analog
parent signal. This suggests to us the following discrete version of Fourier transform for
a discrete sequence
{ }
1 1 0
,......, ,
N
x x x

1
0
2
) ( ) (
N
n
N
mn j
e n x m X

(4)
Our next job should be to come up with inverse transformation. Assuming for N-samples
1 1 0
. ,......... ,
N
x x x
that (4) would be a transformation and if (2) defines IFT in continuous
domain, in the discrete domain, we can hypothesize following inverse transform.

1
0
2
) (
1
) (
N
m
N
mn j
e m X
K
n x

(5)
Where K is a suitable scaling factor.
Our next job is to verify that (4) and (5) indeed define a transformation pair
Substituting (4) in (5), we get following expression for right hand side of (5)
Right hand side
N
mn j
N
m
N
k
N
mk j
e e k x
K
2
1
0
1
0
2
) (
1

1
]
1

(6)
[Note the use of dummy subscript
k
]
Let us work this expression out in a long hand fashion; for compactness we use notation
) (n x x
n


2
0 1 1
2 2 2 2 ( 1) 2
0 1 1
2 ( 1) 2 ( 1) 2 ( 1) 2 ( 1) 2 ( 1)
0 1 1
0
1
1
1
N
j n j j n j N j n
N N N N N
N
j N n j N j N n j N j N n
N N N N N
N
x x x m
x e x e e x e e m
RHS
K
x e x e e x e e m N

+ + + 1
1

+ + + +

+ +

+ + + +
]
1
1
1
1
1
In the above expression, for the first row
m
is set to zero, for the second row it is set to
one and for the last row
1 N m
Now, grouping terms column wise, we get
1
1
1
]
1

+ + + +
+ + + + + + +


) 1 (
) 1 ( ) 1 (
1
) 1 (
) 1 ( 2
) 1 (
2
1
) 1 )( 1 ( 2 ) 1 ( 2
1
) 1 ( 2 2
0
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



1
0
1
0
) (
2
1
N
k
N
m
k n
N
m j
k
e x
K


Note that this jugglery shows that we can interchange the summation order. One order
indicates row wise and another column wise summation
i.e.

1
0
1
0
) (
2
1
N
k
N
m
k n
N
m j
k
e x
K
RHS

(7)
Our primary task now is to evaluate the expression.

1
0
) (
2
N
m
k n
N
m j
e

We now claim that

;
;
0
1
0
) (
2
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

1
. 0 .
) (
2
Hence, the first case is obvious.
Now, if
n k
, let
1
k n k


) 1 )( (
2
1 ) (
2
0 ) (
2
1
0
) (
2

+ + +

N k n
N
j
k n
N
j
k n
N
j
N
m
k n
N
m j
e e e e

Now,
( )
m
k
m
k
N
j
m k
N
j
a e e
1
1 1
2 2

,
_


where
N
j
e a
2

1
1
1
1 1
2
2 2 2 1 1
( )
2 2
0 0
1 1
0
1 1
j
k N m
j m j k N N N
n k j k
N N
j j
k k
m m
N N
e e
e e
e e



_

,


_



,


if
1
k
is integer, then
1
1
2

k j
e

Note that we have used the following geometric series expression
r
r a
ar ar a
n
n

+ + +

1
) 1 (
........
1
Thus, RHS in (6) is equal to
n
x
K
N
We see that equation (6) defines the inverse transformation if we choose
K N
;
Thus, N-point DFT and IDFT for samples
[ ]
1 1 0
,..... ,
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

2
1
0
1
0
2
) (
1
) (
) (

Note that in general DFT and inverse DFT can be defined in many ways, each only
differing in choice of constant
1
C
and
2
C
DFT IDFT
i.e.

1
0
2
1
) (
N
n
N
nm j
n
e x C m X

1
0
2
2
) (
N
m
N
nm j
n
e m X C x

The constraint in choosing the constraints is that product
N
C C
1
2 1

For Example, when

N
C C
1
, 1
2 1



2
1 2
2 1
C
N
C

N
C
N
C
1 1
2 1

Choice of
N
C
2
1

is commonly used in relaying because it simplifies phasor estimation.
Phasor estimation will be discussed later.
We now discuss some important properties of DFT.
Important Properties of DFT (Lecture 7)
(1) Linearity: Let
{ }
1 1 0
,...... ,
N
x x x
and
{ }
1 1 0
,...... ,
N
y y y
be two sets of discrete
samples with corresponding DFTs given by
) (m X
and
) (m Y
. Then DFT of
sample set
{ }
1 1 1 1 0 0
.., ,......... ,

+ + +
N N
y x y x y x
is given by
) ( ) ( m Y m X +
Proof:

1
0
2
) (
N
n
N
nm j
n
e x m X

;

1
0
2
) (
N
n
N
nm j
n
e y m Y

+ +
1
0
2
) ( ) ( ) (
N
n
N
mn j
n n
e y x m Y m X

(2) Periodicity : We have evaluated DFT at
1 ,........, 1 , 0 N m
. There after,
( ) m N
it shows periodicity. For example

) ( ) 2 ( ) ( ) 2 ( ) ( ) ( m kN X m N X m N X m N X m N X m X + + + + +
Where
k
is an integer
Proof:

+
1
0
) (
2
) (
N
n
m kN
N
n j
n
e x m kN X

1
0
2
2
N
n
kn j
N
nm j
n
e e x

(8)
Both
k
and
n
are integers. Hence
1
2

kn j
e

; Therefore from (8) we set

) ( ) (
1
0
2
m X e x m kN x
N
n
N
nm j
n
+


(3) DFT symmetry : If the samples
n
x
are real, then extracting in frequency domain
) 1 ( )........ 0 ( N X X
seems counter intuitive; because, from N bits of information
in one domain (time), we are deriving 2N bits of information in frequency
domain. This suggests that there is some redundancy in computation of
) 1 ( .... )......... 0 ( N X X
. As per DFT symmetry property, following relationship
holds.

) ( ) (
*
m X m N X

1 ,....., 1 , 0 N m
Proof:

1
0
2
) (
N
n
N
nm j
n
e x m X


1
0
) (
2
) (
N
n
m N
N
n j
n
e x m N X


=
n j
N
n
N
nm j
n
e e x

2
1
0
2

Since
2
1,
j n
e

integer follows that



1
0
2
) (
N
n
N
nm j
n
e x m N X

1
0
*
2
) (
N
n
N
nm j
n
e x


*
1
0
2
1
]
1

N
n
N
nm j
n
e x


* *
( ( )) ( ) X m X m
If the samples
n
x
are real; then they contain atmost
N
bits of information. On
the other hand,
) (m X
is a complex number and hence contains 2 bits of
information. Thus, from sequence
{ }
1 1 0
,....., ,
N
x x x
, if we derive
{ } ) 1 ( ),......., 1 ( ), 0 ( N X X X
, it implies that from N-bit of information, we are
deriving
N 2
bits of information. This is counter intuitive. We should expect
some relationship in the sequence
{ } ) 1 ( ),......., 1 ( ), 0 ( N X X X
Thus, we conclude that

) ( ) ( m X m N X
[Symmetry]
and
) ( ) ( m X m N X
[Anti-symmetry]
Thus, a typical DFT magnitude and phase plots appear as follows.
( ) X m
Fig (3)
Fig (4)
DFT phase shifting:-
DFT shifting property states that, for a periodic sequence with periodicity N i.e.
) ( ) ( lN m x m x +
,
l
an integer, an offset in sequence manifests itself as a phase shift in
the frequency domain. In other words, if we decide to sample x(n) starting at n equal to
some integer K, as opposed to n=0, the DFT of those time shifted samples.
) (m X
shifted

2
shifted
( ) ( )
j Km
N
X m e X m


Starting DFT with say
this sample will lead
to offset of 2
Fig (5)

1
2
) ( ) (
n k
k n
N
nm j
shifted
e k x m X

Proof: By periodicity of samples, we have

) 0 ( ) ( x N x


) 1 ( ) 1 ( x N x +

) 1 ( ) 1 ( + K x K N x

1
0
2
) (
N
n
m
N
n j
n
e x m X



+
1
2
1
0
2
N
K n
N
nm j
n
K
n
N
nm j
n
e x e x



+
+
1
2
1
0
2
N
K n
N
nm j
n
K
n
N
nm j
n N
e x e x


1
]
1

+
+
1
2
1
2
1
0
) ( 2
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

+
1
2
1
2
N
K n
N
nm j
n
K N
N n
N
nm j
n
e x e x

1
2
) (
K N
K n
m
N
n j
n
e x m X

(8)
Now to compute
shifted
X
, let us map the samples
1 1
,........, ,
+ + K N K K
x x x
to
1 1 0
........., ,
N
y y y
.
Apply DFT to sequence
y

1
0
2
) (
N
n
N
nm j
n shifted
e y m X

1
0
2
N
n
m
N
n j
n K
e x

1
0
) (
2 2
N
n
K n
N
m j
n K
N
mK j
e x e

1
2 2
K N
K n
N
N
n j
n
N
nK j
e x e


) (
2
m X e
n
N
nK j

(from (8))
Review Questions:
1. Compute 8 pt DFT
( 0, 7) m
of the following sequence.
(0) 0.35 x

(1) 0.33 x

(2) 0.68 x

(3) 1.07 x

(4) 0.40 x

(5) 1.12 x

(6) 1.35 x

(7) 0.35 x
Hence, illustrate the various DFT properties discussed in this
lecture.
2. By using inverse DFT, show that discrete samples can be recovered with
knowledge of
(0), ........ (7) x x
3. Calculate the N pt DFT of rectangular function given by,
0 1 1
.......... 1
N
x x x


.
Verify the various DFT properties for this signal.
Computation of Phasor from DFT: (Lecture 8)
Consider a sinusoidal input signal of frequency
0

, given by

) sin( 2 ) (
0
+ t X t x
(9)
This signal is conveniently represented by a phasor
X

(cos sin )
j
X Xe X j

+
(10)
Assuming that
( ) t x
is sampled
N
times per cycle s.t
0 s
T Nt
of the 50Hz waveform,
0
50 f
to produce the sample set {
k
x
}, Then,

)
2
sin( 2

+ k
N
X x
k
(11)
Hence, An integer m, in the transform domain corresponds to frequency mF
0
. Thus,
choice m=1 corresponds to extract the fundamental frequency component. The discrete
Fourier Transform of
k
x
contains a fundamental frequency component given by
s
F N

1
0
2
1
2
N
k
k
N
j
k
e x
N
X

(12)


1
0
1
0
)
2
sin(
2
)
2
cos(
2
N
k
N
k
k k
k
N
x
N
j k
N
x
N


s c
jX X
(13)
where

1
0
)
2
cos(
2
N
k
k c
k
N
x
N
X

(14)

1
0
)
2
sin(
2
N
k
k s
k
N
x
N
X

(15)
Substituting for
k
x
from (11) in (12) and (13) it can be shown that for a sinusoidal input
signal given by (9)

cos 2 sin 2 X X X X
s c

(16)
From equation (10), (13) and (14) it follows that

( )
1
1 1
2 2
s c
X jX X jX +
(17)
When the input signal contains other frequency components as well, the phasor
calculated by equation (17) is a filtered fundamental frequency phasor. It is presumed
here that the input signal must be band-limited to satisfy the Nyquist Criterion, to avoid
errors due to aliasing affects.

Effect on phasor computation
In relaying applications during steady state we will be working with moving
window, such that each window having most recent N-samples. Let
w
c
X
and
w
s
X
indicate
c
X
and
s
X
component of DFT for
th
w
window (window no. bery equal to 1
st
sample
no.). Then, by DFT define
1
0
2 2
cos
N
w
c k w
k
X x k
N N


1
0
2 2 2
2 sin cos
N
k
X k w k
N N N

_
+ +

,

1
0
2 4 2 2
sin sin
N
k
X
k w w
N N N N

_ _
+ + + +
' ;

, ,

2 2
0 sin
X
N w
N N

_
+ +
' ;

,

2
2 sin X w
N

_
+

,
Similarly,
1
0
2 2
sin
N
w
k w
k
s
X x k
N N


1
0
2 2 2
2 sin sin
N
k
X k w k
N N N

_
+ +

,

1
0
2 2 4 2
cos cos
N
k
X
w k w
N N N N

_ _
+ + +
' ;

, ,

2 2
cos
XN
w
N N

_
+

,
2
2 cos X w
N

_
+

,
Hence, DFT estimated at
th
w
window for (m = 1) is given by
2 2
(1) 2 sin cos
w w w
c s
X X jX X w j w
N N


_ _ _
+ +

, , ,
Hence, phasor estimate at
th
w
window
( )
1 2 2
cos sin
2
w
w w
s c
X X jX X w j w
N N


_ _ _
+ + + +

, , ,
2
j w
N
X e

_
+

,

2
j w
j
N
X e e

Thus, we see that with moving window, the phasor estimate rotates at a speed of
2
j
N
e

per
window. This rotate in phasor during computation can be directing derived from DFT
phase shifting properties.
This suggests that
N
j
K
e jX
N
K X
2
1
) 1 (
2
) (

phasor estimated for


th
n
window rotates at
speed
N
2

per sample.
In the computation of phasor, we would not like this phasor shift to occur due to DFT
phase shifting. This can be avoided if we use equation (8) for computing DFT. Replace
k

by
w
, the window number, we get

2
1
2
( )
j km
k w
N
k c s
k w
X m x e X jX
N

+

Where
1
2
( ) cos
N w
w
c k
k w
km
X m x
N


(9)

1
2 2
( ) sin
N w
w
s k
k w
km
X m x
N N


(10)
Example: let
) sin( t x
With sampling rate of N-samples per cycle we have
N
T
t
s
0

;

)
2
sin( )
2
sin(
0
0
N
n
N
T
n
T
x
n



Substituting
k
x
in equation (9), we get

1
2 2 1 2 2
2sin cos
2
N w
w
c
k w
X k km
X
N N N

_ _
+

, ,

1
2 2 1 2 2
sin (1 ) sin (1 )
2
N w
k w
X k k
m m
N N N


+

1 _ _
+ + + +
1
, , ]

2 sin X

1
2 2 1 2 2
2sin sin
2
N w
w
k w
s
X k km
X
N N N

_ _
+

, ,



1
2 2 1 2 2
cos( (1 ) ) cos( (1 ) ) 2 cos
2
N w
k w
X k k
m m X
N N N


+

1
+ + +
1
]

sin( ) x t +

( )
1
2
w
w w
s s
X X jX X +

t
a
From equation (10) and (11), we have
1
2 2
( ) cos
N w
w
c k
k w
km
X m x
N N


and
1
2 2
( ) sin
k N w
w
s k
k w
km
X m x
N N


. The computation for
w
c
X
can be visualized from the
following pair wise multiplication and add sequence show in red in the figure -
Now, to compute
1
( )
w
c
X m
+
, we get one new sample.
w N
x
+
and computation of
1
( )
W
c
X m
+

is
( )
w
c
X m
shown by pairing in green boundary. It is now obvious, that
( )
1
2 2
( ) ( ) cos cos
w w
c c w N w
X m X m x N w m x wm
N N

+
+
_ _
+ +

, ,
. Since,
( )
2 2 2
cos cos 2 cos N w m m wm wm
N N N

_ _ _
+ +

, , ,
for m an integer, we get
( )
1
2
( ) ( ) cos
w w
c c w N w
X m X m x x wm
N

+
+
_
+

,
-------- (12)
Similarly, for sine component, we have
1
2
( ) ( ) [ ]sin
w w
w N w s s
X m X m x x wm
N

+
+
_
+

,
----(13)
Eqns. 12 and 13 provide a recursive update for DFT computation. The advantage of
recursive form is that it reduces computation from 2-N multiply- add operation in normal
DFT into additions and 2 multiplication is respectively.
To begin with we will get
( ) ( ) 0
w w
s s
X m X m
. When the first window is full populated
with N-samples, we will correct values of
( )
c
X m
and
( )
m
X m
. Afterwards, for a
stationary phasor
w N w
x x
+

and hence, the DFT latches in the appropriate phasor.
w
x

2 ( 2)
cos
w m
N
+

2 w
x
+

1 w N
x
+

2
cos ( 1) N w m
N

+

w N
x
+
2
cos ( ) N w m
N


1
( )
w
c
X m
+

( )
w
c
X m
Half Cycle DFT Form for Phasor Estimation
If our primary interest is to extract fundamental phasor component in the signal then, it
can be verified that, restricting moving window to half a cycle does not alter the end
result of eqn. (5) and (6) provided that N-now represents, number of samples per half-
cycle. Now, the sample
k
x
is given by
2 sin
k
x k
N

_
+

,
. Thus, half cycle form of
DFT phasor estimation is given by the following eqns.
1
2
cos
N w
w
c k
k w
X x k
N N


----(14)
1
2
sin
N w
w
k
k w
s
X x k
N N


----(15)
Advantage of half cycle algorithm is that the moving window latches on to the post fault
signal in
1
2
a cycle. Thus, compared to full cycle version, it is twice as fast. A keen
observer would have noticed that DFT based on moving window phasor estimation
equations are identical to the full cycle and cycle fourier algorithms derived in lecture-x.
Thus, the frequency response of fourier algorithms developed in lecture x applies to the
DFT version. In particular, it is not surprising to see that harmonic rejection property of
half cycle algorithm is inferior to its full cycle avatar. This is consistent with the Speed
vs accuracy conflict, we have discussed earlier.
Half Cycle Recursive DFT
Recursive form of half cycle DFT can be derived in an analogous manner to full cycle
DFT. Realizing that
( ) cos cos N w m m mw
N N

_ _
+ +

, ,
cos modd mw
N


( ) sin sin N w m m mw
N N

_ _
+ +

, ,
sin modd mw
N


we get following recursive update forms for fundamental phasor computation
1
( ) cos
w w
c c w N w
X X x x w
N

+
+
+
1
( ) sin
w w
w N w s s
X X x x w
N

+
+
+
Review Questions
1. Consider, the following signal
( )
10sin(2 50 30 )
t
x t +
a) Generate samples on this waveform using sampling frequency of samples
per cycle.
b) Apply full cycle and half cycle algorithms to estimate phasor from
generalized DFT approach.
c) Repeat (b) using recursive forms.
2. Now consider the following signal.

10
( ) 10sin(2 50 30 ) 5sin(4 50 17.5 ) cos(6 50 75 )
3
x t t t t + + + + +
Repeat (2) and comment on the accuracy of full cycle and half cycle estimation
methods.

Vous aimerez peut-être aussi