Lecture 06 - DFT windiwing.pdf

Embed Size (px)

Citation preview

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    1/12

    1

    Lecture 6: Windowing of DFT

    Instructor:

    Dr. Gleb V. Tches lavski

    Contact: [email protected]

    Office Hours: Room 2030

    Class web site:

    http://ee.lamar.edu/gleb/dsp/index.htm

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    by Steve Higgins

    2

    The idea of windowing

    ( )Recall: j j nnX e x e

    = (6.2.1)- not really practicaln=

    What if we observe aninfinitely longsequence over a finitelength time window?

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    0 D-1Than we dont see therest of the signal.

    Let D is the number of samples (data points) observed.

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    2/12

    3

    Windowing; what it causes

    R

    n n nWe specify y W x = (6.3.1)- a windowed view of xn

    where:1, 0,1,..., 1

    0

    R

    n

    n DW

    otherwise

    = =

    (6.3.2)

    yn is a D- sequence (finite length), therefore, we can evaluate its DFT.

    ( ) ( ) ( )( )1j R j j

    ny Y e W e X e d

    = (6.3.3)

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    periodic convolution property

    ( )j

    Y e

    Therefore, is a dispersed/convoluted/obscured view of ( )j

    X e

    ( ) 2 , 0,1,..., 1k

    j

    n kkDFT

    P

    y Y Y e k P =

    = = zero-padded length

    (6.3.4)

    4

    Windowing; what it causes (cont)

    ( )0 0a sinusoid 2 ( 2 )j n j

    nDTFT

    l

    Let x e X e l = = + (6.4.1)

    ( ) ( ) ( )0( )01

    2 ( 2 )2

    jj R j R

    l

    Y e W e l d W e

    = + =If 0 [-, ]

    (6.4.2)

    0

    2

    , 0,1,... 1

    kj

    R P

    kFrequency sampling Y W e k P

    = =

    (6.4.3)

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    ( ) 02 2 2

    11

    2

    1 1 10 2 2 2

    sin1 2

    1sin

    2

    D D Dj j j

    Dj DDj

    j nR j R

    n jj j jn

    De e e

    eW e W e e

    ee e e

    =

    = = = =

    (6.4.4)

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    3/12

    5

    Leakage

    ( ) 0 2 , 1,2,...R j zl

    W e lD

    = = = (6.5.1)

    ( )

    ( )

    sin / 20;

    sin / 2

    DWhen D

    Let D = 100

    (6.5.2)

    40

    60

    80

    100

    Spectrum of a rectangular window

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    -0.3 -0.2 -0.1 0 0.1 0.2 0.3-40

    -20

    0

    20

    2

    D

    4

    D

    2

    D

    4

    D

    This is what causes so calledleakage observation offrequency components that donot exist in the spectrum of thesignal Due to observation only!

    6

    Frequency sampling

    80

    100

    DFT means frequencysam lin !

    80

    100

    -20

    0

    20

    40

    60

    2

    D

    4

    D

    2

    D

    4

    D

    -20

    0

    20

    40

    60

    We can only observe specificfrequency components of thesinc curve, and, therefore, cansee only the specific frequencycomponents of our signal!

    -

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    -0.3 -0.2 -0.1 0 0.1 0.2 0.3-40

    -0.3 -0.2 -0.1 0 0.1 0.2 0.3-40

    of observed frequency samples.

    BUT! our sinusoid leaves at 0 and this is the only frequency where we expect it tobe! Therefore, by smart choice of P we can observe the signal ONLY at 0 and atthe zero-crossings, i.e. at

    0

    2, 0,1, ...l l

    P

    = = (6.5.1)

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    4/12

    7

    Characteristics of window functions

    Windows characteristics

    101

    20

    lg|Y|

    Peak Side Lobelevel (PSL), dB

    Side Lobe Roll-off (SLR),dB/octave

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    -0.3 -0.2 -0.1 0 0.1 0.2 0.310

    0

    Main lobe width(MLW)

    at xx dB

    rectangular window4

    D

    8

    Characteristics of window functions

    Windows characteristics

    101

    20

    lg|Y|

    We want:

    MLW narrow for betterspectral resolution PSL lower to have lessmasking for nearby

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    -0.3 -0.2 -0.1 0 0.1 0.2 0.310

    0

    SLR better (faster) tohave less masking for faraway components

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    5/12

    9

    Multiple sinusoids

    ( )an input is a mixtureof sinusoids: m m

    j n

    n m

    m

    Usually x A e +

    = (6.9.1)

    1 1Remember : cos( )

    2 2m m m mj n j j n j

    m mn e e e e + = +

    Assume for simplicity that m= 0 for every m.

    ( )

    2

    ( )

    2 ( 2 )

    mm

    j

    m m

    m l

    j kjj R R P

    m k m

    X e A l

    Y e A W e Y A W e

    = +

    = =

    (6.9.2)

    (6.9.3)

    (6.9.4)

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    m m

    As a consequence, for two equal amplitude sinusoids, we will observe 2

    peaks of |Yk| about half the time (depending on relative phase) when thefrequency difference is:

    1 2 2 D = = - Rayleigh limit of frequencyresolution related to the window!

    (6.9.5)

    10

    Multiple sinusoids

    3535

    Two sinusoids at the Rayleigh limit

    0

    5

    10

    15

    20

    25

    30

    Magnitude(dB)

    5

    10

    15

    20

    25

    30

    Magnitude(dB)

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-10

    -5

    Normalized Frequency (rad/sample)0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

    -5

    0

    Normalized Frequency (rad/sample)

    Phase shift 0o Phase shift 90o

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    6/12

    11

    Multiple sinusoids

    Phase shift 180o 30

    40

    -30

    -20

    -10

    0

    10

    20

    Magnitude(dB)

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-40

    Normalized Frequency (rad/sample)

    Two sisoids are NOT resolved! They appear as a single peak in thefrequency domain!

    12

    Multiple sinusoids

    40

    )

    35

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-20

    0

    20

    Normalized Frequency ( rad/sample)

    Magnitude(dB

    -20

    0

    20

    gnitude(dB)

    -10

    -5

    0

    5

    10

    15

    20

    25

    30

    Magnitude(dB)

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    DFTs of two sinusoids ofdifferent frequencies anddifferent 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-40

    Normalized Frequency ( rad/sample)

    Ma

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-15

    Normalized Frequency ( rad/sample)

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    7/12

    13

    Multiple sinusoids

    Masking 30

    40S

    1

    S

    one signal isobscured byanother inthe freq.domain

    -10

    0

    10

    20

    Magnitude(dB)

    S1+S

    2

    0

    0.5

    1

    1.5

    1+S2

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    e nee abetter window!

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-40

    -30

    -20

    Normalized Frequency (rad/sample)

    0 20 40 60 80 100

    -1.5

    -1

    -0.5S=

    Time, samples

    ( )

    ( )

    1

    2

    sin 3

    0.1sin 3 5

    s n

    s n D

    =

    = +

    14

    Multiple sinusoids

    Alternative 40

    S1

    von Hannwindow

    Two sins canbe resolved!!

    -60

    -40

    -20

    0

    Magnitude(dB)

    S2

    S1+S

    2

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-120

    -100

    -80

    Normalized Frequency ( rad/sample)

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    8/12

    15

    Multiple sinusoids

    40

    Rectangular

    i

    -60

    -40

    -20

    0

    Magnitude(dB)

    iwo w n owscomparison

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-120

    -100

    -80

    Normalized Frequency (rad/sample)

    16

    Different DFT windows

    Rectangular (Boxcar) window

    1, 0,1,... 1nW n D= = (6.14.1)

    ELEN 5346/4304 DSP and Filter Design Fall 2008

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    9/12

    17

    Different DFT windows

    von Hann (Hanning) window

    1 cos sin , 0,1,... 12 1 1

    nW n DD D

    = = (6.15.1)

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    18

    Different DFT windows

    Hamming window

    0.54 0.46cos , 0,1,... 11

    nW n DD

    = = (6.16.1)

    ELEN 5346/4304 DSP and Filter Design Fall 2008

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    10/12

    19

    Different DFT windows

    Blackman window

    0.42 0.5cos 0.08cos , 0,1,... 11 1

    nW n DD D

    = + = (6.17.1)

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    20

    Different DFT windows

    Kaiser window2

    0

    21 1

    1

    nI

    D

    ( )0, 0,1,... 1K

    nW n DI

    = = (6.18.1)

    ELEN 5346/4304 DSP and Filter Design Fall 2008

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    11/12

    21

    Different DFT windows

    Different windows comparison

    Window MLW (2/D) PSL (dB) SLR (dB/oct)Rectangular 0.9 -13 -6

    Hanning 2 -31 -18

    Hamming 2 -41 -6

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    Blackman 3 -57 -18

    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

    22

    Summary

    Windowing of a simple waveform, like cos(0t) causes itsFourier transform to have non-zero values (commonly calledleakage) at frequencies other than 0. It tends to be worst(highest) near 0 and least at frequencies farthest from 0.If there are two sinusoids, with different frequencies, leakagecan interfere with the ability to distinguish them spectrally. Iftheir frequencies are dissimilar, then the leakage interfereswhen one sinusoid is much smaller in amplitude than the

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    other. That is, its spectral component can be hidden by theleakage from the larger component. But when thefrequencies are near each other, the leakage can besufficient to interfere even when the sinusoids are equalstrength; that is, they become unresolvable.

  • 8/14/2019 Lecture 06 - DFT windiwing.pdf

    12/12

    23

    Conclusions

    Selection of a window function for DFT must be donebased on the application. A rectangular window is thechoice when a high frequency resolution is desired.However, this type of window may a be a bed pick ifwe expect signals in a wide dynamic range.

    ELEN 5346/4304 DSP and Filter Design Fall 2008

    ?Questions?