Você está na página 1de 23

ELEN 5346/4304 DSP and Filter Design Fall 2008

1
Lecture 6: Windowing of DFT
Instructor:
Dr. Gleb V. Tcheslavski
Contact: gleb@ee.lamar.edu
Office Hours: Room 2030
Class web site:
http://ee.lamar.edu/gleb/dsp/ind
ex.htm
by Steve Higgins
ELEN 5346/4304 DSP and Filter Design Fall 2008
2
The idea of windowing
( )
Recall:
j j n
n
n
X e x e
e e

=
=

(6.2.1)
- not really practical
What if we observe an
infinitely long
sequence over a finite
length time window?
0 D-1
Than we dont see the
rest of the signal.
Let D is the number of samples (data points) observed.
ELEN 5346/4304 DSP and Filter Design Fall 2008
3
Windowing; what it causes
R
n n n
We specify y W x = (6.3.1)
where:
1, 0,1,..., 1
0
R
n
n D
W
otherwise
=

(6.3.2)
y
n
is a D- sequence (finite length), therefore, we can evaluate its DFT.
( ) ( ) ( )
( )
1
2
n
DTFT
j R j j
Y e W e X e d y
t
e u e u
t
u
t

=
}
periodic convolution property
( )
j
Y e
e
Therefore, is a dispersed/convoluted/obscured view of
( )
j
X e
e
(6.3.3)
- a windowed view of x
n

( )
2
, 0,1,..., 1
k
j
n k
k DFT
P
y Y Y e k P
e
t
e =
= =
zero-padded length
(6.3.4)
ELEN 5346/4304 DSP and Filter Design Fall 2008
4
Windowing; what it causes (cont)
( )
0
0
a sinusoid 2 ( 2 )
j n j
n
DTFT
l
Let x e X e l
e e
t o e e t = = +

(6.4.1)
( ) ( ) ( )
0
( )
0
1
2 ( 2 )
2
j j R j R
l
Y e W e l d W e
t
e e e u
t
t o e u e t u
t

= + =

}
If e
0
e [-t, t]
(6.4.2)
0
2
0, , 1,... 1
k
j
R P
k
Y W e Frequency sampling k P
t
e
(

(

| |
= |
|
\ .
=
(6.4.3)
( )
0
2 2 2
1
1 1 1
0
2 2 2
1
2
sin
2
si
2
1
n
1
D D D
j j j
j D
D
j n R
n
j
j j
D
j
R j
j
n
e e e
e
W e
e
e e
e
e
D
W
e
e e e
e
e
e e
e
e e e
e
e

=
| |
| |
|
\ .

\ .
= = =
| |

|
\
=
| |
|
\
.
.

(6.4.4)
delay due to a center of the window
ELEN 5346/4304 DSP and Filter Design Fall 2008
5
Leakage
( )
( )
sin / 2
0;
sin / 2
D
When D
e
e
e

Let D = 100
( )
0 2 , 1, 2,...
R j
z
l
W e l
D
e
e t = = =
(6.5.1)
(6.5.2)
-0.3 -0.2 -0.1 0 0.1 0.2 0.3
-40
-20
0
20
40
60
80
100
2
D
t

4
D
t

2
D
t 4
D
t
Spectrum of a rectangular window
This is what causes so called
leakage observation of
frequency components that do
not exist in the spectrum of the
signal Due to observation only!
ELEN 5346/4304 DSP and Filter Design Fall 2008
6
Frequency sampling
-0.3 -0.2 -0.1 0 0.1 0.2 0.3
-40
-20
0
20
40
60
80
100
2
D
t

4
D
t

2
D
t 4
D
t
DFT means frequency
sampling!
-0.3 -0.2 -0.1 0 0.1 0.2 0.3
-40
-20
0
20
40
60
80
100
We can only observe specific
frequency components of the
sinc curve, and, therefore, can
see only the specific frequency
components of our signal!
Zero-padding increases number
of observed frequency samples.
BUT! our sinusoid leaves at e
0
and this is the only frequency where we expect it to
be! Therefore, by smart choice of P we can observe the signal ONLY at e
0
and at
the zero-crossings, i.e. at
0
2
, 0,1,... l l
P
t
e e = =
(6.5.1)
ELEN 5346/4304 DSP and Filter Design Fall 2008
7
Characteristics of window functions
-0.3 -0.2 -0.1 0 0.1 0.2 0.3
10
0
10
1
2
0

l
g
|
Y
|
Main lobe width
(MLW)
at xx dB
Windows characteristics
Peak Side Lobe
level (PSL), dB
Side Lobe Roll-
off (SLR),
dB/octave
rectangular window
4
D
t

ELEN 5346/4304 DSP and Filter Design Fall 2008
8
Characteristics of window functions
Windows characteristics
-0.3 -0.2 -0.1 0 0.1 0.2 0.3
10
0
10
1
2
0

l
g
|
Y
|
We want:
MLW narrow for better
spectral resolution
PSL lower to have less
masking for nearby
components
SLR better (faster) to
have less masking for far
away components
ELEN 5346/4304 DSP and Filter Design Fall 2008
9
Multiple sinusoids
( )
an input is a mixture of sinusoids :
m m
j n
n m
m
Usually x A e
e +
=

(6.9.1)
1 1
Remember : cos( )
2 2
m m m m
j n j j n j
m m
n e e e e
e e
e

+ = +
Assume for simplicity that
m
= 0 for every m.
( )
( ) ( )
2
( )
2 ( 2 )
m
m
j
m m
m l
j k
j j R R P
m k m
m m
X e A l
Y e A W e Y A W e
e
t
e
e e e
t o e e t
| |

\ .
= +
| |
= = |
|
\ .


As a consequence, for two equal amplitude sinusoids, we will observe 2
peaks of |Y
k
| about half the time (depending on relative phase) when the
frequency difference is:
1 2
2 D e e e t = =
- Rayleigh limit of frequency
resolution related to the window!
(6.9.2)
(6.9.3)
(6.9.4)
(6.9.5)
ELEN 5346/4304 DSP and Filter Design Fall 2008
10
Multiple sinusoids
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-10
-5
0
5
10
15
20
25
30
35
Normalized Frequency (t rad/sample)
M
a
g
n
i
t
u
d
e

(
d
B
)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-5
0
5
10
15
20
25
30
35
Normalized Frequency (t rad/sample)
M
a
g
n
i
t
u
d
e

(
d
B
)
Phase shift 0
o
Phase shift 90
o

Two sinusoids at the Rayleigh limit
ELEN 5346/4304 DSP and Filter Design Fall 2008
11
Multiple sinusoids
Phase shift 180
o

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-40
-30
-20
-10
0
10
20
30
40
Normalized Frequency (t rad/sample)
M
a
g
n
i
t
u
d
e

(
d
B
)
Two sisoids are NOT resolved! They appear as a single peak in the
frequency domain!
ELEN 5346/4304 DSP and Filter Design Fall 2008
12
Multiple sinusoids
DFTs of two sinusoids of
different frequencies and
different magnitudes.
DFT of their sum
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-20
0
20
40
Normalized Frequency (t rad/sample)
M
a
g
n
i
t
u
d
e

(
d
B
)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-40
-20
0
20
Normalized Frequency (t rad/sample)
M
a
g
n
i
t
u
d
e

(
d
B
)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-15
-10
-5
0
5
10
15
20
25
30
35
Normalized Frequency (t rad/sample)
M
a
g
n
i
t
u
d
e

(
d
B
)
ELEN 5346/4304 DSP and Filter Design Fall 2008
13
Multiple sinusoids
Masking
one signal is
obscured by
another in
the freq.
domain
We need a
better window!
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-40
-30
-20
-10
0
10
20
30
40
Normalized Frequency (t rad/sample)
M
a
g
n
i
t
u
d
e

(
d
B
)


S
1
S
2
S
1
+S
2
0 20 40 60 80 100
-1.5
-1
-0.5
0
0.5
1
1.5
S

=

S
1

+

S
2
Time, samples
( )
( )
1
2
sin 3
0.1sin 3 5
s n
s n D t
=
= +
ELEN 5346/4304 DSP and Filter Design Fall 2008
14
Multiple sinusoids
Alternative
von Hann
window

Two sins can
be resolved!!
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-120
-100
-80
-60
-40
-20
0
20
40
Normalized Frequency (t rad/sample)
M
a
g
n
i
t
u
d
e

(
d
B
)


S
1
S
2
S
1
+S
2
ELEN 5346/4304 DSP and Filter Design Fall 2008
15
Multiple sinusoids
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-120
-100
-80
-60
-40
-20
0
20
40
Normalized Frequency (t rad/sample)
M
a
g
n
i
t
u
d
e

(
d
B
)


Rectangular
Hanning
Two windows
comparison
ELEN 5346/4304 DSP and Filter Design Fall 2008
16
Different DFT windows
Rectangular (Boxcar) window
1, 0,1,... 1
R
n
W n D = =
(6.14.1)
ELEN 5346/4304 DSP and Filter Design Fall 2008
17
Different DFT windows
von Hann (Hanning) window
2
1 2 2
1 cos sin , 0,1,... 1
2 1 1
N
n
n n
W n D
D D
t t | |
( (
= ~ =
|
( (


\ .
(6.15.1)
ELEN 5346/4304 DSP and Filter Design Fall 2008
18
Different DFT windows
Hamming window
2
0.54 0.46cos , 0,1,... 1
1
M
n
n
W n D
D
t
(
= =
(


(6.16.1)
ELEN 5346/4304 DSP and Filter Design Fall 2008
19
Different DFT windows
Blackman window
2 4
0.42 0.5cos 0.08cos , 0,1,... 1
1 1
B
n
n n
W n D
D D
t t
( (
= + =
( (


(6.17.1)
ELEN 5346/4304 DSP and Filter Design Fall 2008
20
Different DFT windows
Kaiser window
( )
2
0
0
2
1 1
1
, 0,1,... 1
K
n
n
I
D
W n D
I
to
to
| |
(
|

(
|

\ .
= =
(6.18.1)
ELEN 5346/4304 DSP and Filter Design Fall 2008
21
Different DFT windows
Window MLW (2t/D) PSL (dB) SLR (dB/oct)
Rectangular ~ 0.9 -13 -6
Hanning ~ 2 -31 -18
Hamming ~ 2 -41 -6
Blackman ~ 3 -57 -18
Different windows comparison
MLW narrow for better spectral resolution
PSL lower to have less masking from nearby components
SLR better (faster) to have less masking from far away components
ELEN 5346/4304 DSP and Filter Design Fall 2008
22
Summary
Windowing of a simple waveform, like cos(e
0
t) causes its
Fourier transform to have non-zero values (commonly called
leakage) at frequencies other than e
0
. It tends to be worst
(highest) near e
0
and least at frequencies farthest from e
0
.
If there are two sinusoids, with different frequencies, leakage
can interfere with the ability to distinguish them spectrally. If
their frequencies are dissimilar, then the leakage interferes
when one sinusoid is much smaller in amplitude than the
other. That is, its spectral component can be hidden by the
leakage from the larger component. But when the
frequencies are near each other, the leakage can be
sufficient to interfere even when the sinusoids are equal
strength; that is, they become unresolvable.
ELEN 5346/4304 DSP and Filter Design Fall 2008
23
Conclusions
Selection of a window function for DFT must be done
based on the application. A rectangular window is the
choice when a high frequency resolution is desired.
However, this type of window may a be a bed pick if
we expect signals in a wide dynamic range.
?Questions?

Você também pode gostar