Beruflich Dokumente
Kultur Dokumente
=
=
| |
( )
1
2 /
0
[ ]
N
j N kn
n
X k x n e
t
=
=
DFS Pair
| |
( )
1
2 /
0
[ ] 0 1
0
N
j N kn
n
x n e k N
X k
else
t
s s
| |
( )
1
2 /
0
1
0 1
[ ]
0
N
j N kn
k
X k e n N
x n N
else
t
s s
PERIODIC
ONE PERIOD ONLY
| | | |
DFT
x n X k
1
0
[ ] ( ) , 0 1
N
kn
N
n
X k x n W k N
=
= s s
1
0
1
[ ] ( ) , 0 1
N
kn
N
k
x n X k W n N
N
=
= s s
Analysis equation
Synthesis equation
Lectures 16-17 EE-802 ADSP SEECS-NUST
DFT-Ex: Rectangular Pulse
Minimum Value of N ?
Minimum Value of N = 5
| |
( )
( )
4
2 / 5
0
2
2 / 5
1
1
5 0, 5, 10,...
0
j k n
n
j k
j k
X k e
e
e
k
else
t
t
t
DFS
Required N = 5-point DFT
Lectures 16-17 EE-802 ADSP SEECS-NUST
DFT- Frequency Interpretation
1
0
[ ] ( ) , 0 1
N
kn
N
n
X k x n W k N
=
= s s
DFT determines the spectral content of input at N equally spaced frequency points
What are the exact frequencies in the DFT spectrum?
depends on the number of DFT points N and
on the sampling frequency f
s
, at which the original signal was sampled
X[k] : frequency content at discrete radial frequency: (rad/sample)
or cycles/sample
In real frequency terms (Hz) :
k
N
k
t
e
2
=
N
k
f
k
=
N
kf
f
s
=
analysis
In case your sampling frequency is not specified or not known, we talk of normalized
frequency (scale from -0.5 to 0.5)
Lectures 16-17 EE-802 ADSP SEECS-NUST
DFT- Example
-1.5
-1
-0.5
0
0.5
1
1.5
0 1 2 3 4
5
6
7
n
)
4
3
2000 2 sin( 5 . 0 ) 1000 2 sin( ) (
t
t t + + = t t t x
Sample it with f
s
= 8000 Hz and take 8 samples
x[n]
0 1 2 3 4 5 6 7
0
0.5
1
1.5
2
2.5
3
3.5
4
k
|
X
[
k
]
|
Plug back in manually the real freq. axis
X[1] corresponds to 1x8000/8 = 1000 Hz
X[2] corresponds to 2x8000/8 = 2000 Hz
What are X[6] and X[7]?
-4000 -3000 -2000 -1000 0 1000 2000 3000
0
0.5
1
1.5
2
2.5
3
3.5
4
f(Hz)
|
X
(
f
)
|
Apply 8-point DFT
Lectures 16-17 EE-802 ADSP SEECS-NUST
DFT Leakage
N = 64 (samples of input signal)
Falls in DFT Bin # k =3
NO DFT Bin # k = 3.4
Leaks into multiple DFT Bins
Lectures 16-17 EE-802 ADSP SEECS-NUST
DFT Leakage (The reality)
-4000 -3000 -2000 -1000 0 1000 2000 3000 4000
0
5
10
15
20
25
X= 875
Y= 15.9248
X= 750
Y= 24.4898
f (Hz)
) 800 2 sin( ) ( t t x t =
Sample it with f
s
= 8000 Hz and take 64 samples
Apply 64-point DFT
Lectures 16-17 EE-802 ADSP SEECS-NUST
DFT Leakage Work Around
Windowing (rectangular) is always taking place
For sinusoids with integer number of cycles in analysis period,
leakage does not occur
Unfortunately, for practical signals leakage will always be an issue
So we need to ensure better leakage management
One solution is to use better windows with reduced side lobes
Hamming, Hanning, Triangular, etc.
Cost paid would be the reduced resolution of different frequencies
Self-Exercises
Further Reading Understanding DSP (Lyons)
Chapter 3 : DFT (Sections 3.2, 3.5, 3.8, 3.9, 3.13, 3.17)
Practice on MATLAB at least with sinusoids and different
windows to clarify your concepts
Lectures 16-17 EE-802 ADSP SEECS-NUST
Properties of DFT-Linearity
| | | |
| | | |
| | | | | | | |
1 1
2 2
1 2 1 2
DFT
DFT
DFT
x n X k
x n X k
ax n bx n aX k bX k
+ +
N
1
= length (x
1
)
N
2
= length (x
2
)
length (x
3
) = N
3
= max(N
1
, N
2
)
x
3
denote the sum sequence
For DFT of x
3
to meaningful, compute DFTs of x
1
and x
2
on length N
3
DFT of greater length than actual samples can be computed by zero
padding
Lectures 16-17 EE-802 ADSP SEECS-NUST
Properties of DFT-Circular Shift
| | | |
( )
( ) | |
( )
2 /
0 n N-1
DFT
j k N m
DFT
N
x n X k
x n m X k e
t
s s
Lectures 16-17 EE-802 ADSP SEECS-NUST
Circular Convolution as Linear
Convolution with Aliasing
[ ] ( )
DTFT j
x n X e
e
2
[ ] ( )
k
j
N
X k X e
t
=
[ ] [ ]
r
x n x n rN
=
=
s s
=
[ ] 0 1
[ ]
0 otherwise
p
x n n N
x n
s s
( ) ( ) ( )
3 1 2
j j j
X e X e X e
e e e
=
Linear Convolution:
| |
( )
( )
2 /
3 3
, 0 1
j k N
X k X e k N
t
= s s
| |
( )
( )
( )
( )
2 / 2 /
3 1 2
, 0 1
j k N j k N
X k X e X e k N
t t
= s s
3 1 2
3
3
[ ] [ ] [ ]
[ ] 0 1
[ ]
0 otherwise
IDFT
r p
X k X k X k
x n rN n N
x n
=
=
s s
=
=
s s
=
=
[ ] 0 1
[ ]
0 otherwise
r
x n rL n L
x n
+ s s
where
| | | | | | n h n x n y - =
| | | | | | n h rL n x n y
r
r
- =
=0
| | | | | | n h n x n y
r r
- =
| | | |
=
=
0 r
r
rL n y n y
Linear filtering of total input
Linear filtering of each
input section
Total output = Addition of individual
outputs (separated by L samples)
Lectures 16-17 EE-802 ADSP SEECS-NUST
Overlap Add Method
Linear convolution = circular convolution if N = L+P-1
zero-pad filter (L-1 zeros) and input (P-1 zeros)
Take N-point DFTs of input chunk and filter
Multiply the DFTs to get an output chunks DFT
Take IDFT to obtain one chunk of output
Repeat for next input chunk of L samples
Add (overlapping) output sections to obtain overall output
Lectures 16-17 EE-802 ADSP SEECS-NUST
Overlap Save Method
Partition input into overlapping sections (length L) & overlap (P-1) samples
Use N = L point DFTs and IDFTs (to obtain output chunks of length L)
time aliasing will occur as N = L+P-1 is not satisfied
discard starting P-1 points because they are incorrect (aliased)
Retain the correct data of length L-(P-1) points & patch them together (save)