practical spectral analysis - binghamton personal page/ee521... · 2007-08-16 · 2/22 goal of...

22
1/22 Practical Spectral Analysis (Porat Chapter 6)

Upload: others

Post on 29-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

1/22

Practical Spectral Analysis

(Porat Chapter 6)

Page 2: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

2/22

Goal of Practical Spectral AnalysisGoal: Given a discrete-time signal x[n], use DFT (via FFT)

to analyze its spectral content – in particular, to detect the presence of sinusoids and estimate their frequency.

Challenges: 1. Available signal may be short (e.g., a radar signal

may only be “on” for a very short time).2. If the signal is long, then the spectral content may

change with time (e.g., music spectrum changes with time) – so spectrum may be considered to be constant only a block-by-block basis where the blocks are short.

Both of these drive the need to apply the DFT to a short signal record Challenge = Resolution & Accuracy

Page 3: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

3/22

Example Application (Electronic Warfare) Intercept T seconds of a Radar Pulse Train p(t), Compute DFT, detect &

estimate peaks to identify type of radar.

“Underlying” Pulse Train is Periodic Fourier Series

∑ −=n

tffjnn

pcectp )(2)( π

tp(t)

PRI

fp = 1/PRIFS

Since DFT shows samples of the DTFT of the finite duration signal we can study what the DFT gives us by looking at what the DTFT of a finite-duration signal looks like!!

f

)( fPF

fc fp

FTDTFT

of InfiniteDuration

Signal

θ

)(fT θP

fc fp

DFT Shows Samples of This DTFT

DFT

Signal Samples

0

N-1

DTFTof FiniteDuration

Signal

Page 4: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

4/22

Effect of Windowing

Porat Sections 6.1 and 6.2

Page 5: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

5/22

Basic Viewpoint of Signal Data We are given a finite # of signal samples, and want to use them to see the spectrum of the infinite-duration signal….How well can we do that?

Math Model for having a finite # of samples:

⎩⎨⎧ −≤≤

=otherwise ,0

10],[][

Nnnynx

Infinite Duration SignalFinite Duration Signal Available for Processing

Better Math Model – Rectangular Window-Based Model:

⎩⎨⎧ −≤≤

==otherwise ,0

10,1][ where],[][][

Nnnwnwnynx rr

Page 6: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

6/22

Implication of Window-Based Model Since the available data x[n] is related to the unavailable signal y[n] through multiplication we can use the Multiplication Theorem for DTFT (Eq. (2.103) in Porat) to find out what we get!Thus, the DTFT of the signal data is related to the DTFT of the infinite-duration signal by: { }

∫−

−=

⊕=

π

π

λθλλπ

θπ

θ

dWY

WYX

r

r

)()(21

)(*21)(

ff

fff

where the DTFT of the rect. window is:

)2/sin()2/sin(

2

2

111)(

2)1(

2/2/2/

2/2/2/

1

0

f

/][/][

θθ

θ

θ

θθθ

θθθ

θ

θθ

Ne

jeee

jeee

eeeW

Nj

jjj

NjNjNj

j

NjN

n

njr

−−

−−

−−

−−

=

=

−=

−== ∑

Use Euler!

)2/sin()2/sin(),(

θθθ NND Δ=

Use Geometric Sum

Page 7: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

7/22

The “Dirichlet Kernel” D(θ,N)• Looks like “sinc”, except periodic• Mainlobe Gets Narrower as N↑• Sidelobes “Get Lower” as N↑• Height of Mainlobe = N

Looks more like delta as N↑

-3 -2 -1 0 1 2 3-5

0

5

10

15

θ/π

-3 -2 -1 0 1 2 3-20

0

20

40

60

θ/π

N=41

N=11

D(θ

,41)

D(θ

,11)

Nearest Zero@ θ=2π/N

Largest Sidelobe–13 dB w.r.t. ML peak

(For Any N)

Mainlobe Width = 4π/N

Page 8: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

8/22

Impact of Window

-3π -2π -π 0 π 2π 3π-0.5

0

0.5

1

1.5

Digital Frequency θ (rad/sample)

-10

0

10

20

0

10

20

0

0.5

1

1.5

-3π -2π -π 0 π 2π 3π

-3π -2π -π 0 π 2π 3π

-3π -2π -π 0 π 2π 3π

)(f θY

)2/(fr θπ −W

)2/()( fr

f θπθ −WY

{ } )(* ff θrWY ⊕

To Compute @ π/2Shift Window DTFT by π/2Form ProductIntegrate -π to π

Mainlobe EffectSmoothes Edges

Sidelobe Effect“Leakage”

Page 9: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

9/22

Impact of Window (pt. 2)

Recall: F(θ)*δ(θ – α) = F(θ – α) so…. { }[ ])()(

21

)(*21)(

2f

21f

1

fff

θθθθπ

θπ

θ

−+−=

⊕=

rr

r

WAWA

WYX

Consider a signal consisting of two complex sinusoids:

[ ] Elsewhere Repeats,),()()(

][

2211f

2121

ππθθθδθθδθ

θθ

−∈−+−=

+=

AAY

eAeAny njnj

-3π -2π -π 0 π 2π 3π-0.5

0

0.5

1

1.5

Digital Frequency θ (rad/sample)

)(f θY

-3π -2π -π 0 π 2π 3π

)(fr iW θθ −

Sidelobe Leakage (“SL Interference”)Large Sidelobes Obscure Small Sinusoid

Page 10: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

10/22

Impact of Window (pt. 3)Consider a signal consisting of two complex sinusoids closely spaced in frequency and similar in amplitude:

-3π -2π -π 0 π 2π 3π

)(fr iW θθ −

-3π -2π -π 0 π 2π 3π-0.5

0

0.5

1

1.5

Digital Frequency θ (rad/sample)

)(f θY

-3π -2π -π 0 π 2π 3π

)(f θX

Mainlobe SmearingWide Mainlobe “Smears” Sinusoids Together

Page 11: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

11/22

Common Windows

Porat Section 6.3

Page 12: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

12/22

Desirable Window PropertiesWe’ve seen that to minimize the impact of a window we need the DTFT of the window Wf(θ) to have:

• Narrow Mainlobe– Mainlobe Width usually measured “zero-to-zero”

•Small Sidelobe Levels– Measured in dB relative to mainlobe peak– Care about “Highest Sidelobe” & “Drop-off Rate”

We’ll see that there is an inherent trade-off between these two desires:

Lowering the Sidelobes Causes a Widening of the Mainlobe

Page 13: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

13/22

“Kernel” Wf(θ) for Rectangular Window

-π -π/2 0 π/2 π-60

-40

-20

0

θ (rad/sample)

20lo

g 10|W

f (θ)|

(dB

)

Rectangular WindowThis is what you get if you don’t explicitly apply some other type of window – it is due to the fact that you have only N signal samples available.

• Mainlobe Width = 4π/N Good!!!

Bad!!!Need to get these lower!!!

But HOW????•Sidelobe Levels

– Largest Sidelobe = –13 dB– Sidelobe Drop-off Rate = –6 dB/octave (except near ± π)

Page 14: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

14/22

Bartlett WindowInspiration: Square the (non-dB) rect. kernel

-0.2π -0.1π 0 0.1π 0.2π0

10

20

30

40

50

-0.2π -0.1π 0 0.1π 0.2π0

500

1000

1500

2000)(f θrW [ ]2f )(θrWP

αP, α<1

P2

α2P2

Sidelobe Ratio = αP/P = α Sidelobe Ratio = α2P2/P2 = α2 < α

So… in time-domain this corresponds to convolving 2 rect. windows:

* =N/2 N/2 N

Bartlett WindowAlso called Triangular

Window

Page 15: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

15/22

-π -π/2 0 π/2 π-60

-40

-20

0

“Kernel” Wf(θ) for Bartlett Window20

log 1

0|Wf (θ

)| (d

B)

θ (rad/sample)

Bartlett Window (pt. 2)

• Mainlobe Width = 8π/(N+1) ≈ 2 ×Wider Than Rect

Better than Rect-27 dB vs. –13 dB

-12 dB/oct vs. -6 dB/oct•Sidelobe Levels

– Largest Sidelobe = –27 dB– Sidelobe Drop-off Rate = –12 dB/octave (except near ± π)

Page 16: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

16/22

Hann Window (also called Hanning)Inspiration: “Add” three shifted (non-dB) rect. kernels together to try to cancel sidelobes:

Hann Kernel

θ (rad/sample)

)1

2(25.0)1

2(25.0)(5.0)( fr

fr

fr

fhn −

+−−

−−=N

WN

WWW πθπθθθ

[ ])}1/(2cos{15.010,25.025.05.0][ )1/(2)1/(2

hn−−=

−≤≤−−= −−−

NnNneenw NnjNnj

π

ππ

Use DTFT Freq. Shift Property

Hann Window

Added Sidelobes“Cancel”

Page 17: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

17/22

Hann Window (pt. 2)

• Mainlobe Width = 8π/(N) 2 ×Wider Than Rect

“Kernel” Wf(θ) for Hann Window20

log 1

0|Wf (θ

)| (d

B)

θ (rad/sample)

-π -π/2 0 π/2 π-100

-80

-60

-40

-20

0

Even Better than Bartlett-32 dB vs. –27 dB

-18 dB/oct vs. -12 dB/oct•Sidelobe Levels

– Largest Sidelobe = –32 dB– Sidelobe Drop-off Rate = –18 dB/octave (except near ± π)

Page 18: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

18/22

Hamming WindowInspiration: Tweak Hann coefficients to get lower “highest SL”

)1

2(23.0)1

2(23.0)(54.0)( fr

fr

fr

fhm −

+−−

−−=N

WN

WWW πθπθθθ

)}1/(2cos{46.054.0][hn −−= Nnnw π

Hamming Window

0 10 20 30 400

0.5

1

Index n 0 10 20 30 400

0.5

1

Index n

Hanning Window

-π -π/2 0 π/2 π-100

-80

-60

-40

-20

0

Frequency θ (rad/sample)-π -π/2 0 π/2 π

-100

-80

-60

-40

-20

0

Frequency θ (rad/sample)

-18 dB/oct-6 dB/oct

Page 19: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

19/22

Hamming Window (pt. 2)

• Mainlobe Width = 8π/(N)2 ×Wider Than Rect (same as Hanning)

Note: Both Rect & Hamming have –6 dB/oct drop-offNote also: Both are discontinuous at window edge in time-domain

Even Better than Hanning–43 dB vs. –32 dB

As Bad as Rect!!–6 dB vs. –6 dB

• Sidelobe Levels– Largest Sidelobe = –43 dB– Sidelobe Drop-off Rate = –6 dB/octave (except near ± π)

Page 20: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

20/22

Drop-Off Rate & Discontinuity OrderDefinition: If the window’s time-domain function is such that up to its (p-1)th derivative (but no higher) is continuous, then we say that the signal has p-order continuity.

Ex. Rectangular Window has 0-order continuity Triangular Window has 1-order continuityHamming Window has 0-order continuity

Result: A window that has continuity of order p will (generally) have a kernel that has a sidelobe drop-off rate of –(p+1)6 dB/oct

Rectangular Window has 0-order continuity: - 6dB/oct Hamming Window has 0-order continuity: - 6dB/octTriangular Window has 1-order continuity: - 12dB/oct Hann Window has 2-order continuity: - 18dB/oct

Page 21: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

21/22

Other Windows & Their RationaleLots of effort has been focused on designing good windows. Here are a few, with their design rationale and their “specs”

Blackman: “More Tweaking of Hann Coefficients”ML Width = 12π/N SL Level = -57 dB Drop-Off = -18 dB/oct

Kaiser: “Minimize width for SL energy not exceeding spec’d % of total”ML Width = variable SL Level = variable Drop-Off = -6 dB/oct

Dolph: “Minimize width for SL level not exceeding spec’d level”ML Width = variable SL Level = variable Drop-Off = 0 dB/oct

Page 22: Practical Spectral Analysis - Binghamton personal page/EE521... · 2007-08-16 · 2/22 Goal of Practical Spectral Analysis Goal: Given a discrete-time signal x[n], use DFT (via FFT)

22/22

Comparison of Windows

0.8 1 1.2 1.4 1.6 1.8 2-100

-90

-80

-70

-60

-50

-40

-30

-20

-10

Mainlobe “3dB BW” (“Bins”)

Hig

hest

Sid

elob

e Le

vel (

dB)

Rectangle

TriangleHann

Blackman

Hamming

Dolph

Kaiser

Boundary Line

Data taken from table in F. J. Harris, “On the use of windows for harmonic analysis with the discrete Fourier transform,” Proc. IEEE, vol. 66, pp. 51 – 83, January 1978.