Sunteți pe pagina 1din 9

DIGITAL SIGNAL PROCESSING

Discrete Fourier Transform


Solved problems:


1. Find the Discrete Fourier Transform of the following signal:
} 1 , 1 , 1 , 1 { 3 , 2 , 1 , 0 ], [ = = n n f .

Solution:
The Discrete Fourier Transform (DFT) of the discrete signal f[n]
is F[k]:
N
j
N
n
k n
e W N k W n f k F
2
1
0
, 1 ,... 1 , 0 , ] [ ] [

= = =

where for
In our case, N=4 so the last equation for F[k], written in matrix
notation is:
f T F = , where T is matrix of the transform, with elements T
ij
=W
ij
,
i, j = 0..N - 1:
j W j W
j e e W
W W W
W W W
W W W
F
F
F
F
j j
= = =
= = =
(
(
(
(

(
(
(
(

=
(
(
(
(


3 2 2
2 4
2
9 6 3
6 4 2
3 2
; 1 ) (
;
1
1
1
1
1
1
1
1 1 1 1
] 3 [
] 2 [
] 1 [
] 0 [


Using the property of periodicity of W ( Z r W W
N r p p
=
+
, ) with
basic period N=4, we get:
j W W W W W W W W W = = = = = = = = =
8 9 4 2 9 9 2 4 6 6 0 4 4 4
; 1 ; 1
Now we can compute F[k], k=0..3 with this matrix equation:
(
(
(
(

=
(
(
(
(

(
(
(
(




=
(
(
(
(

j
j
j j
j j
F
F
F
F
2 2
0
2 2
0
1
1
1
1
1 1
1 1 1 1
1 1
1 1 1 1
] 3 [
] 2 [
] 1 [
] 0 [

DFT of the signal f[n], n=0..3 is F[k], k=0..3 = {0, 2-2j, 0, 2+2j}


2. Find the inverse DFT of F[k], k=0,1,2,3 = {0, 2-2j, 0, 2+2j}.

Solution:
The Inverse Discrete Fourier Transform (IDFT) of F[k] is the
signal f[n]:
1 ,... 1 , 0 , ] [
1
] [
1
0
= =

=

N n W k F
N
n f
N
k
k n
, where
N
j
e W
2

=
The last equation written in matrix notation is:
F T
N
1
F T f
* 1
= =

, where T is the matrix of transform.
From previous we have
(
(
(
(




=
(
(
(
(




=
j j
j j
j j
j j
1 1
1 1 1 1
1 1
1 1 1 1
,
1 1
1 1 1 1
1 1
1 1 1 1
*
T T so
(
(
(
(

=
(
(
(
(

(
(
(
(




=
(
(
(
(

1
1
1
1
2 2
0
2 2
0
1 1
1 1 1 1
1 1
1 1 1 1
1
] 3 [
] 2 [
] 1 [
] 0 [
j
j
j j
j j
N
f
f
f
f

We got that IDFT of F[k], k=0..3 is the signal f[n], n=0..3 = {1, 1, -1, -1}.


3. Find the Z-transform of the following signal:
f[n], n=...-2,-1,0,1,2,3,5,... = {...0, 0, 1, 1, -1, -1, 0, 0,...}
Find its frequency spectrum for the following frequencies:
2
3
, ,
2
, 0

= = = = T T T T and

Solution:
The Z-transform of the signal f[n] is:
) 1 ( ) 1 ( ) 1 ( 1 1 ] [ ) (
2 1 1 2 1 3 2 1

+ = + + = + = =

z z z z z z z z z n f z F
n
n

The frequency spectrum of the signal f[n] is:
) (
T j
e F

=
T j
e z
z F

=
) (
) 1 ( ) 1 ( ) (
2 T j T j T j
e e e F

+ =
The spectrum for the specific frequencies is:
; 2 2 2 ) 1 ( ) 1 ( ) 1 ( ) (
; 0 0 0 ) 1 ( ) 1 ( ) (
; 2 2 2 ) 1 ( ) 1 ( ) 1 ( ) (
; 0 ) 1 1 ( ) 1 1 ( ) (
3
2
3
2
3
2
2 2
0
j j e e e F
e e e F
j j e e e F
e F
j
j j
j j j
j
j j
j
+ = + = + =
= = + =
= = + =
= + =




If we compare the values of the frequency spectrum with the
values from the previous example (DFT of the same signal) we can
see that by computing N-point DFT of a signal we actually
compute N equally-spaced samples from the frequency spectrum of
that signal:
1 ,... 1 , 0 ), ( | ) ( ] [
2
2
= = =

=
N k e F e F k F
k
N
j
k
N
T
T j




4. Find the even and the odd part of the following signals:
f[n], n=0..3 = {1, 1, -1, -1}, and
F[k], k=0..3 = {0, 2-2j, 0, 2+2j}

Solution:
The even part of f[n] is f
p
[n], where f
p
[n] is computed by:
)]) [( ] [ (
2
1
] [ n N f n f n f
p
+ = ,
while odd part of f[n] is f
n
[n]:
)]) [( ] [ (
2
1
] [ n N f n f n f
n
=
Where (N-n) means N n N mod ) ( .
For example, if f[n] is the following signal:
]} 1 [ ], 2 [ ],... 2 [ ], 1 [ ], 0 [ { 1 .. 0 ], [ = = N f N f f f f N n n f ,
then, the signal )] [( n N f is:
]} 1 [ ], 2 [ ],... 2 [ ], 1 [ ], 0 [ { 1 .. 0 )], [( f f N f N f f N n n N f = =
In our case, f[n]={1, 1, -1, -1}, so f[(N-n)]={1, -1, -1, 1}
The even part of f[n] is:
)]) [( ] [ (
2
1
] [ n N f n f n f
p
+ = = {1, 0, -1, 0}, while the odd part is:
)]) [( ] [ (
2
1
] [ n N f n f n f
n
= = {0, 1, 0, -1}.
Similarly, for F[k] we get:
F[(N-k)]={0, 2+2j, 0, 2-2j};
The even part is: F
p
[k]={0, 2, 0, 2};
The odd part is: F
n
[k]={0, -2j, 0, 2j}.


5. Find the DFT of the signals f
p
[n] and f
n
[n], using the results
from the previous example.

Solution:
On figure 14 are shown the correspondences between the real, the
imaginary, the even and the odd parts of signal and his Discrete
Fourier Transform. The black arrow connects the signals
that form transform pair.

Figure 14

According to this property of symmetry of the Discrete Fourier
Transform, if DFT of f[n]={1, 1, -1, -1} is F[k]={0, 2-2j, 0, 2+2j}, then DFT of
the even part of f[n], f
p
[n], which is real, is the real even part
of F[k], that is F
p
[k]={0, 2, 0, 2} (computed in the previous example).
Similarly, DFT of the odd part of f[n], f
n
[n], which is also real,
according to this property is the imaginary odd part of F[k], that
is F
n
[k]={0, -2j, 0, 2j}.



6. If the signal f[n], n=0..N-1 is real and even, show that the
signal F[k]=DFT{f[n]}, k=0..N-1 is also real and even.

Solution:
We know that the signal f[n] is real i.e. ] [ ] [
*
n f n f = , and that is
also even, i.e. )] [( ] [ n N f n f = .
We need to show that:
] [ ] [
*
k F k F = and )] [( ] [ k N F k F = .
If we start from the definition of DFT ] [
*
k F we get:


=

= = =
1
0
1
0
*
1
0
* *
] [ ] [ ] ] [ [ ] [
N
n
k n
N
n
k n
N
n
k n
W n f W n f W n f k F ;
Now, if we use the relation )] [( ] [ n N f n f = :

=

=
1
0
*
)] [( ] [
N
n
k N k n
W W n N f k F , 1
0
= =

W W
k N
due to periodicity of W

=

=
1
0
) ( *
)] [( ] [
N
n
n N k
W n N f k F
The value of the congruence (N-n) is equal to the difference N-n
for all 0 n . For n=0, (N-n)=0, while N-n=N. But, the value of
) ( n N k
W

is same as
)) (( n N k
W

for n=0, so we can make this
replacement:
] [ ] [ )] [( ] [
1
0
1
0
)) (( *
k F W m f W n N f k F
m k
N
m
N
n
n N k
= = =

=



We got that ] [ ] [
*
k F k F = which means that F[k] is real.
In order to show that F[k] is even we start from )] [( k N F :

=

=
1
0
)) ((
] [ )] [(
N
n
k N n
W n f k N F , and same as previously, the value of the
congruence (N-k) is different from N-k only for k=0. But for k=0,
)) (( k N n
W

is same as
) ( k N n
W

, so again we can make the replacement
)) (( k N n
W

=
) ( k N n
W

:


=

=

= =
1
0
1
0
) (
] [ ] [ )] [(
N
n
k n N n
N
n
k N n
W W n f W n f k N F , 1
0
= =

W W
N n

] [ ] [ ) ] [ ( ) ] [ ( ] [ )] [(
*
1
0
*
1
0
* *
1
0
k F k F W n f W n f W n f k N F
N
n
k n
N
n
k n
N
n
k n
= = = = =


=

=


We got that ] [ )] [( k F k N F = which means that F[k] is even.


7. If the length of x[n] is N=4, and if its 8-point DFT is:
} 2 3 , 3 , 2 1 , 1 , 2 1 , 3 , 2 3 , 5 { 7 .. 0 ], [
8
j j j j k k X + + = = , find the 4-
point DFT of the signal x[n].

Solution:
The samples of ] [
8
k X are eight equally-spaced samples from the
frequency spectrum of the signal x[n]:
k T
T j
e X k X
8
2
) ( ] [
8

=
= , k=0..7
More precisely, they are samples from the spectrum for the
following frequencies: }
4
7
,
2
3
,
4
5
, ,
4
3
,
2
,
4
, 0 {


= T .
With 4-point DFT of x[n] we get 4 samples from the spectrum of x[n]:
k T
T j
e X k X
4
2
) ( ] [
4

=
= , k=0..3
These samples are for the following frequencies:
}
2
3
, ,
2
, 0 {

= T
If we compare the two sets of frequencies we can easily see
that:
3 ] 6 [ ) ( ] 3 [
1 ] 4 [ ) ( ] 2 [
3 ] 2 [ ) ( ] 1 [
5 ] 0 [ ) ( ] 0 [
8
2
3
4
8 4
8
2
4
8
0
4
= = =
= = =
= = =
= = =
X e X X
X e X X
X e X X
X e X X
j
j
j
j



So, 4-point DFT of x[n] is: } 3 , 1 , 3 , 5 { ] [
4
= k X


8. Two N-length signals are given, N is even number:
1 .. 0 ], [ 1 .. 0 ], [ = = N n n g N n n f i
The relation between f[n] and g[n] is: ] [ ) 1 ( ] [ n f n g
n
= .
Find the relation between ]} [ { ] [ n g DFT k G = and ]} [ { ] [ n f DFT k F = .

Solution:

=

= =
1
0
1
0
] [ ) 1 ( ] [ ] [
N
n
N
n
k n n k n
W n f W n g k G
if we replace
n
) 1 ( by
jn
e :


=

=


= =
1
0
2
2 2
1
0
2
] [ ] [ ] [
N
n
n
N
N
j k n
N
j
N
n
jn
k n
N
j
e e n f e e n f k G


)]
2
[( ] [ ] [
1
0
)
2
(
2
N
k F e n f k G
N
n
N
k n
N
j
+ = =

=
+

, k=0..N-1
We got that G[k] is circular shifted (for
2
N
samples) version of
F[k].

2. The relation between 1
2
.. 0 ], [ 1 .. 0 ], [ = =
N
n n g N n n f and , where N
is even number, is:
1
2
.. 0 ],
2
[ ] [ ] [ = + + =
N
n
N
n f n f n g
Find the relation between ]} [ { ] [ n g DFT k G = , 1
2
.. 0 =
N
k and the
frequency spectrum of the signal f[n], ) (
T j
e F

.

Solution:


=

+ + = =
1
2
0
1
2
0
])
2
[ ] [ ( ] [ ] [
N
n
k n
N
n
k n
W
N
n f n f W n g k G


=

+ + =
1
2
0
1
2
0
]
2
[ ] [ ] [
N
n
k n
N
n
k n
W
N
n f W n f k G
We multiply the second sum by
k
N
W

2
(its value is 1):


=

+ + =
1
2
0
2
1
2
0
]
2
[ ] [ ] [
N
n
k
N
k n
N
n
k n
W W
N
n f W n f k G



=
+

+ + =
1
2
0
)
2
(
1
2
0
]
2
[ ] [ ] [
N
n
k
N
n
N
n
k n
W
N
n f W n f k G


=

+ =
1
2
1
2
0
] [ ] [ ] [
N
N
m
k m
N
n
k n
W m f W n f k G
1
2
.. 0 ], 2 [ ] [ ] [ ] [
1
0
2
2
1
0
= = = =


=

N
k k F e n f W n f k G
N
n
k n
N
j
N
n
k n


1
2
.. 0 , ) ( ] 2 [ ] [
2
2
= = =
=
N
k e F k F k G
k
N
T
T j


We got that the samples of G[k] are
2
N
equally-spaced samples
from the frequency spectrum of f[n].


9. From the real signal 1 .. 0 ], [ = N n n f , where N is even number,
the following signals g
i
[n], i=1..4 are constructed:
1 .. 0 ], 1 [ ] [
1
= = N n n N f n g

=
=
=
1 2 .. ], [
1 .. 0 ], [
] [
2
N N n N n f
N n n f
n g

=
=
=
1 2 .. , 0
1 .. 0 ], [
] [
3
N N n
N n n f
n g



=
1 2 0 , 0
1 2 0 ],
2
[
] [
4
N n n
N n n
n
f
n g
neparno, e
parno, e


Find the DFT of the signals g
i
[n], i=1..4, and find their relation
with the frequency spectrum ) (
T j
e F

of the signal f[n].

Solution:
Its easy to see that the signal ] [
1
n g is the inverted signal f[n].


=

= =
1
0
2
1
0
1 1
] 1 [ ] [ ] [
N
n
k n
N
j
N
n
k n
e n N f W n g k G


If we make replacement n N m = 1 :


=

=

= =
1
0
) (
2
) 1 (
2
1
0
) 1 (
2
1
] [ ] [ ] [
N
m
k m
N
j N k
N
j
N
m
m N k
N
j
e m f e e m f k G

=

=
1
0
) (
2 2 2
1
] [ ] [
N
m
k m
N
j k
N
j N k
N
j
e m f e e k G


Since 1
2
=
N k
N
j
e

we get that:
] [ ] [
2
1
k F e k G
k
N
j
=


And the relation between ] [
1
k G and ) (
T j
e F

e:
k
N
T
T j
k
N
j
e F e k G

2
2
1
) ( ] [
=
= , k=0..N-1
Since the module of
k
N
j
e
2
is 1, it turns out that with DFT of the
signal ] [
1
n g we get samples from the amplitude spectrum of the
signal f[n].

The signal ] [
2
n g has length of 2N, and its obtained by periodic
extension of f[n].


=

=

+ =
1 2
2
2
1
0
2
2
2
] [ ] [ ] [
N
N n
k n
N
j
N
n
k n
N
j
e N n f e n f k G



If we make replacement m=n-N:
k N
N
j
N
m
k m
N
j
N
n
k n
N
j
e e m f e n f k G

=

+ =

2
2
1
0
2
2
1
0
2
2
2
] [ ] [ ] [


k
N
m
k m
N
j
N
n
k n
N
j
e m f e n f k G ) 1 ( ] [ ] [ ] [
1
0
2
2
1
0
2
2
2
+ =


=

=



) ) 1 ( 1 ( ] [ ] [
1
0
2
2
2
k
N
n
k n
N
j
e n f k G + =


We got that the odd-indexed samples of ] [
2
k G are zero, while the
remaining are equal to the samples of 2 ] [k F :



=
=
1 2 0 , 0
1 2 0 , ) ( 2
] [
2
2
2
N k k
N k k e F
k G
k
N
T
T j
neparno, e
parno, e



The signal ] [
3
n g has length of 2N, and its obtained by adding N
zeros to f[n].
k
N
T
T j
k n
N
j
N
n
N
n
k n
N
j
e F e n f e n g k G
2
2
2
2
1
0
1 2
0
2
2
3 3
) ( ] [ ] [ ] [

=

= = =

, k=0..2N-1
We got that the samples of ] [
3
k G are 2N equally-spaced samples
from the spectrum of f[n].

The signal ] [
4
n g also has length of 2N samples, and its obtained
from f[n] by inserting one zero after every sample from f[n]. The
DFT of ] [
4
n g is:


=

=

= =
1
0
2
2
2
1 2
0
2
2
4 4
] [ ] [ ] [
N
m
k m
N
j
N
n
k n
N
j
e m f e n g k G


k
N
T
T j
N
n
k n
N
j
e F e n f k G

2
1
0
2
4
) ( ] [ ] [
=

=

= =

, k=0..2N-1
We got that the samples of ] [
4
k G are 2N equally-spaced samples
from the spectrum of f[n] for the frequency range from 0 to 4 ,
which means that ] [
4
k G can be obtained with one periodic
expansion of ] [k F .

S-ar putea să vă placă și