Definition:
A discrete time signal x[n] is periodic with period N if and only if
x[n] x[n N ]
for all n .
Meaning: a periodic signal keeps repeating itself forever!
x[n]
Example: a Sinusoid
Consider the Sinusoid:
N 10
since
for all n.
x[n] A cos 2 n
N
with k, N integers.
x[n N ] A cos 2 (n N )
N
A cos 2 n k 2 x[n]
N
for all n.
x[n] 5 cos 2
n 0.1
20
N 20
since
x[n] Ae
2
j k
N
x[n N ] Ae
2
j k
( n N )
N
2
j k
N
Ae
jk 2
x[n]
for all n.
x[n] (1 2 j )e j 0.1 n
We can write it as
x[n] (1 2 j )e
j 2 n
20
Reference Frames
Goal:
We want to write all discrete time periodic signals in terms
of a common set of reference signals.
It is like the problem of representing a vector
reference frame defined by
an origin 0
r
x
in a
e2
Reference
Frame
e1
e2
Reference
Frame
e1
while in space we need three reference vectors e1 , e2 , e3
Reference
Frame
e3
e2
e1
a2 e2
x a1e1 a2 e2
a1e1
0
Where
a1
a2
projection of
projection of
e1
along e2
along
a3e3
a2 e2
Where
x a1e1 a2 e2 a3e3
a1e1
a1
a2
a3
projection of
projection of
projection of
along e1
along e2
along e3
Example: where am I ?
r
x
N
E
e2
0
200m
e1 300m
x[n]
reference signals
ek [n] e
j 2
k
n
N
k 0,..., N 1
as
N 1
x[n] ak ek [n]
k 0
A Simple Example
Take the periodic signal x[n] shown below:
2
1
e0 [n] e
e1[n] e
0
j 2 n
2
1
j 2 n
2
for all n.
1n 1
(1) n
0.3
e0 [n] e
e1[n] e
for all n.
0
j 2 n
2
1
j 2 n
2
1n 1
(1) n
0 if m k
e [n]em [n]
n 0
N if m k
N 1
*
k
Since
N 1
N 1
*
e
k [n]em [n] e
n 0
n 0
mk
j 2
n
N
N 1
e
n 0
mk
j 2
N
1 e j 2 ( m k )
1 e
j 2
mk
N
N 1
x[n]e [n]
n 0
*
k
N 1
*
a
e
[
n
]
e
m m
k [ n]
n 0 m 0
x[ n ]
N 1
am
N 1
m 0
e [n]e
n 0
*
k
X [k ] Nak x[n]e
n 0
2
kn
N
[n] Nak
X [k ] Nak
then
k 0,..., N 1
X [k ] x[n]e
2
kn
N
k 0,..., N 1
n 0
Since x[n] is periodic, we can sum over any period. The general
definition of Discrete Fourier Series (DFS) is
X [k ] DFS x[n]
for any
n0 N 1
n0
n n0
x[n]e
2
kn
N
k 0,..., N 1
1
x[n] IDFS X [k ]
N
N 1
X [k ]e
k 0
2
kn
N
0
1
X [k ] x[n]e
2
nk
2
n 0
Then
X [0] 3,
X [1] 1
x[n]
1
10
X [k ] x[n]e
n 0
2
kn
10
e
n 0
2
kn
10
1 e
1 e
5
2
5k
10
2
j
k
10
if k 1, 2,...,9
if k 0
magnitude
0
0
X [k ]
10
10
phase (rad)
0
-2
0
Example of DFS
Compute the DFS of the periodic signal
x[n] 2 cos(0.5n)
Compute a few values of the sequence
X [k ] x[n]e
2
kn
2
n 0
which yields
X [0] X [1] 2
x[n] x(nTs )
x(t )
1
Fs
Ts
TMAX
N TMAX FS
N 1
2
kn
N
k 0,..., N 1
n0
1
x[n] IDFT X [k ]
N
N 1
X [k ]e
n0
2
kn
N
n 0,..., N 1
x[n] x(nTs )
x(t )
1
Fs
Ts
TMAX
N TMAX FS
N 1
2
kn
N
k 0,..., N 1
n0
1
x[n] IDFT X [k ]
N
N 1
X [k ]e
n0
2
kn
N
n 0,..., N 1
x[n]
1
X [k ] x[n]e
n 0
2
kn
10
e
n 0
2
kn
10
1 e
1 e
5
2
5k
10
2
j
k
10
if k 1, 2,...,9
if k 0
magnitude
0
0
X [k ]
10
10
phase (rad)
0
-2
0
x[n] Ae
j 0 n
0 rad.
, n
x[n] Ae
j 0 n
0 n N 1
2
kn
N
, k 0,..., N 1
n 0
phase
| A|
(rad )
A
0
(rad )
2
kn
N
n 0
N 1
Ae j0 n e
2
kn
N
n0
N 1
Ae
j k
0 n
N
n0
X [k ] A WN k
0
N
WN ( ) e
n 0
j n
1 e j N
1 e j
, k 0,..., N 1
N 1
WN ( ) e j n
n 0
N
sin
e j ( N 1)/2
sin
2
since:
N 1
WN ( ) e j n
n 0
1 e j N
1 e j
e j N /2 e j N /2 e j N /2 e j N / 2
e j / 2 e j /2 e j /2 e j /2
N
sin
j N / 2
j N / 2
j N /2
e
e
e
2
j ( N 1)/2
e j / 2
e j / 2 e j / 2
sin
2
WN ( )
12
10
8
6
4
2
0
-3
-2
-1
2
N
2
N
Example
Consider the sequence
0 0.3 , N 32
W32 0.3
40
30
N 32
20
10
0
0
0 0.3
X [k ] WN 0.3 k 2 , k 0,..., N 1
N
35
30
25
20
15
10
5
0
0
10
15
20
25
30
5 2 / 32 0.312 0.3
0 0.3 , N 256
>> n=0:255;
>>x=exp(j*0.3*pi*n);
>> X=fft(x);
>> plot(abs(X))
See the plot
| X [k ] |
200
150
100
50
0
0
50
100
150
200
250
300
k0
0 ; k0 2 / N
| X [k ] |
200
150
100
50
0
0
50
k0 38
100
150
200
250
300
Example
You take the FFT of a signal and you get this magnitude:
| X [k ] |
1200
1000
800
600
400
200
0
0
k1 27
50
100
k2 81
150
200
250
2
2
1 k1
27
0.2109
N
256
2
2
2 k 2
81
0.6328
N
256
300
DFT of a Sinusoid
Consider a sinusoid with frequency
0 rad.
x[n] A cos(0 n ), n
We take a finite data length
x[n] A cos(0 n ),
0 n N 1
2
kn
N
, k 0,..., N 1
n 0
A j j 0 n A j j 0 n
x[n] e e
e e
2
2
magnitude
phase
A/ 2
A/ 2
(rad )
(rad )
A j j0 n
A j j0 n
X [k ] DFT e e DFT
e e
2
2
A j j (2 0 ) n
A j j0 n
X [k ] DFT e e DFT
e e
2
2
A j j (2 0 ) n
A j j0 n
X [k ] DFT e e DFT
e e
2
2
magnitude
A/ 2
0
phase
A/ 2
2 0
2 0
(rad )
(rad )
Example
Consider the sequence
0 0.3 , N 32
2 0.3
N / 2 32 / 2
15
N / 2 32 / 2
10
5
0
0
0 0.3
0 1.7
2
N
, k 0,..., N 1
20
15
10
5
0
0
10
15
20
25
30
5 2 / 32 0.3
35
Symmetry
If the signal x[n] is real, then its DFT has a symmetry:
X [k ] X [ N k ]*
In other words:
| X [k ] || X [ N k ] |
X [k ] X [ N k ]
Then the second half of the spectrum is redundant (it does not
contain new information)
10
15
20
25
30
35
If the signal is real we just need the first half of the spectrum,
since the second half is redundant.
10
If the signal is real we just need the first half of the spectrum,
since the second half is redundant.
15
0 0.3 , N 256
>> n=0:255;
>>x=cos(0.3*pi*n);
>> X=fft(x);
>> plot(abs(X))
See the plot
| X [k ] |
100
80
60
40
20
0
0
50
k0 38
100
150
200
250
N k0 218
0 38 2 / 256 0.3
Example
You take the FFT of a signal and you get this magnitude:
| X [k ] |
150
100
50
0
0
50
k1 27 k2 81
100
150
200
250
2
2
1 k1
27
0.2109
N
256
2
2
2 k 2
81
0.6328
N
256
300