You are on page 1of 53

MUS421/EE367B Lecture 3 FFT Windows

Outline

April 26, 2005

Rectangular, Hann, Hamming

MLT Sine

Blackman-Harris Window Family

Slepian and Kaiser

Dolph-Chebyshev

Bartlett

Poisson

Gaussian

Optimal Windows

1

The Rectangular Window

Previously, we looked at the rectangular window:

w R (n)

=

1,

|n| ≥ M1

2

0, otherwise

Zero−Phase Rectangular Window − M = 21

1 0.8 0.6 0.4 0.2 0 −20 −15 −10 −5 0 5 10 15 20
1
0.8
0.6
0.4
0.2
0
−20
−15
−10
−5
0
5
10
15
20
Amplitude

Time (samples)

The window transform was found to be

W R (ω) = sin M ω

2

sin ω

2

=

M · asinc M (ω)

(1)

where asinc M (ω) denotes the aliased sinc function.

asinc M (ω)

=

sin(M ω/2)

M · sin(ω/2)

2

This result is plotted below:

DFT of a Rectangular Window of length M = 11

12 10 8 6 4 2 0 −2 −4 −3 −2 −1 0 1 2
12
10
8
6
4
2
0
−2
−4
−3
−2
−1
0
1
2
3
Amplitude

Normalized Frequency

(rad/sample)

Note that this is the complete window transform, not just its magnitude. We obtain real window transforms like this only for symmetric, zero-centered windows.

3

More generally, we may plot both the magnitude and phase of the window versus frequency:

DFT of a Rectangular Window − M = 11

11 10 9 8 7 6 5 4 3 2 1 −3 −2 −1 0
11
10
9
8
7
6
5
4
3
2
1
−3
−2
−1
0
1
2
3
Amplitude

Normalized Frequency

(rad/sample)

Phase of Rectangular Window Transform (M = 11)

3.5343 3.1416 2.7489 2.3562 1.9635 1.5708 1.1781 0.7854 0.3927 Main Lobe 0 −0.3927 −3 −2
3.5343
3.1416
2.7489
2.3562
1.9635
1.5708
1.1781
0.7854
0.3927
Main Lobe
0
−0.3927
−3
−2
−1
0
1
2
3
Phase (rad)

Normalized Frequency

4

(rad/sample)

In audio work, we more typically plot the window transform magnitude on a decibel (dB) scale:

DFT of a Rectangular Window − M = 11

0 −5 main lobe −10 13 dB down −15 sidelobes sidelobes −20 −25 −30 −35
0
−5
main lobe
−10
13 dB down
−15
sidelobes
sidelobes
−20
−25
−30
−35
nulls
nulls
−40
−3
−2
−1
0
1
2
3
Magnitude (dB)

Normalized Frequency

5

(rad/sample)

Since the DTFT of the rectangular window approximates the sinc function, it should “roll off” at approximately 6 dB per octave, as verified in the log-log plot below:

DFT of a Rectangular Window − M = 20

0 −6.0206 Ideal −6 dB per octave line −12.0412 −18.0618 Partial Main −24.0824 Lobe −30.103
0
−6.0206
Ideal −6 dB per octave
line
−12.0412
−18.0618
Partial
Main
−24.0824
Lobe
−30.103
−36.1236
−42.1442
−48.1648
−54.1854
0.1
0.2
0.4
0.8
1.6
3.2
6.4
Amplitude (dB)

Normalized Frequency (rad/sample)

As the sampling rate approaches infinity, the rectangular window transform converges exactly to the sinc function. Therefore, the departure of the roll-off from that of the sinc function can be ascribed to aliasing in the frequency domain, due to sampling in the time domain.

6

Sidelobe Roll-Off Rate

In general, if the first n derivatives of a continuous

function w(t) exist (i.e., they are finite and uniquely defined), then its Fourier Transform magnitude is asymptotically proportional to

|W(ω)| constant

ω n+1

(as ω → ∞)

Proof: Papoulis, Signal Analysis, McGraw-Hill, 1977

Thus, we have the following rule-of-thumb:

n derivatives ↔ −6(n + 1) dB per octave roll-off rate

(since 20 log 10 (2) = 6.0205999

.).

This is also 20(n + 1) dB per decade.

To apply this result, we normally only need to look at the window’s endpoints. The interior of the window is usually differentiable of all orders.

Examples:

Amplitude discontinuity ↔ −6 dB/octave roll-off

Slope discontinuity ↔ −12 dB/octave roll-off

Curvature discontinuity ↔ −18 dB/octave roll-off

For discrete-time windows, the roll-off rate slows down at high frequencies due to aliasing.

7

In summary, the DTFT of the M -sample rectangular window is proportional to the ‘aliased sinc function’:

asinc M (ωT)

=

Some important points:

sin(ωM T /2)

M · sin(ωT /2)

sin(πf M T )

= sinc(f M T )

MπfT

Zero crossings at integer multiples of M

= 2π

M

where M

= 2π

M

= frequency sampling interval for a

length M DFT

Main lobe width is 2Ω M = 4π

M

As M gets bigger, the mainlobe narrows (better frequency resolution)

M has no effect on the height of the side lobes (Same as the “Gibbs phenomenon” for Fourier series)

First sidelobe only 13 dB down from main-lobe peak

Side lobes roll off at approximately 6dB per octave

A phase term arises when we shift the window to make it causal, while the window transform is real in the zero-centered case (i.e., centered about time 0)

8

Generalized Hamming Window Family

Consider the following picture in the frequency domain:

0.5 0.4 0.3 0.2 0.1 0 −0.1 −0.2 −2.5 −2 −1.5 −1 −0.5 0 0.5
0.5
0.4
0.3
0.2
0.1
0
−0.1
−0.2
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
Amplitude

ω/M

We have added 2 extra aliased sinc functions (shifted), which results in the following behavior:

There is some cancellation of the side lobes

The width of the main lobe is doubled

9

In terms of the rectangular window transform W R (ω) = M · asinc M (ω) (zero-centered, unit-amplitude case), this can be written as:

W H (ω) = αW R (ω) + βW R (ω M ) + βW R (ω + Ω M )

Using the Shift Theorem dual, we can take the inverse transform of the above equation:

w H = αw R (n) + βe j M n w R (n) + βe j M n w R (n)

=

w R (n) α + 2β cos 2πn

M

Choosing various parameters for α and β result in different windows in the generalized Hamming family, some of which have names.

10

Hann or Hanning or Raised Cosine

The Hann window is defined by the settings α = 1/2 and β = 1/4:

w H (n) = w R (n)

1

2 +

1 2 cos(Ω M n) = w R (n) cos 2 M n

2

Hann Window, M = 21

1 0.8 0.6 0.4 0.2 0 −20 −15 −10 −5 0 5 10 15 20
1
0.8
0.6
0.4
0.2
0
−20
−15
−10
−5
0
5
10
15
20
Amplitude

Time (samples)

0 −10 −20 −31.5 dB −30 −40 −50 −60 −70 −3 −2 −1 −2 0
0
−10
−20
−31.5 dB
−30
−40
−50
−60
−70
−3
−2
−1
−2
0
2
1
2
3
M+1
M+1
Magnitude (dB)

Normalized Frequency (rad/sample)

11

Hann window properties:

Mainlobe is 4Ω M wide

1st side lobe is at -31dB

Side lobes roll off at approx. 18dB / octave

Hamming

This window is determined by choosing α to cancel the first side lobe and β to normalize peak amplitude to 1 in the time domain:

α

=

25

46 0.54

β

=

(1 α)/2

Note: The Hamming window is very close to the generalized Hamming window which minimizes sidelobe level within the family:

α = 0.53836

(minimum peak side-lobe magnitude)

Thus, the Hamming window is also the “Chebyshev Generalized Hamming Window” rounded to two significant digits.

Chebyshev-type designs generally exhibit equiripple error behavior, since the worst-case error (sidelobe level in this case) is minimized (see Dolph-Chebyshev window below)

12

Hamming Window

Hamming Window, M = 21

1 0.8 0.6 0.4 0.2 0 −20 −15 −10 −5 0 5 10 15 20
1
0.8
0.6
0.4
0.2
0
−20
−15
−10
−5
0
5
10
15
20
Amplitude

Time (samples)

0 −10 −20 −30 −40.6 dB −40 −50 −60 −70 −3 −2 −1 −2 0
0
−10
−20
−30
−40.6 dB
−40
−50
−60
−70
−3
−2
−1
−2
0
2
1
2
3
M−1
M−1
Magnitude (dB)

Normalized Frequency (rad/sample)

13

Hamming Window Properties

Discontinuous “slam to zero” at endpoints

main lobe is 4Ω M

Roll off is approx. 6 dB / octave (aliased)

1st side lobe is improved over Hann

side lobes closer to “equal ripple”

14

Longer Hamming Window

Hamming Window, M = 101

1 0.8 0.6 0.4 0.2 0 −100 −80 −60 −40 −20 0 20 40 60
1
0.8
0.6
0.4
0.2
0
−100
−80
−60
−40
−20
0
20
40
60
80
100
Amplitude

Time (samples)

0 −10 −20 −30 −40 −42.7 dB −50 −60 −70 −3 −2 −1 −2 2
0
−10
−20
−30
−40
−42.7
dB
−50
−60
−70
−3
−2
−1
−2
2
0
1
2
3
M−1 M−1
Magnitude (dB)

Normalized Frequency (rad/sample)

Since the side-lobes nearest the main lobe are most affected by the Hamming optimization, we now have a larger frequency region over which the spectral envelope looks like that of the asinc function (an “aliased -6 dB/octave roll-off”).

The side-lobe level (-42.7 dB) is also improved over that of the shorter window (-40.6 dB).

15

Window Transform Summary

Window Transforms, Window length = 20

0 Rectangular −10 −20 −30 −40 −50 −60 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1
0
Rectangular
−10
−20
−30
−40
−50
−60
−0.5
−0.4
−0.3
−0.2
−0.1
0
0.1
0.2
0.3
0.4
0.5
Magnitude (dB 0 )

Normalized Frequency (cycles per sample)

0 Hanning −10 −20 −30 −40 −50 −60 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1
0
Hanning
−10
−20
−30
−40
−50
−60
−0.5
−0.4
−0.3
−0.2
−0.1
0
0.1
0.2
0.3
0.4
0.5
Magnitude (dB 0 )

Normalized Frequency (cycles per sample)

0 Hamming −10 −20 −30 −40 −50 −60 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1
0
Hamming
−10
−20
−30
−40
−50
−60
−0.5
−0.4
−0.3
−0.2
−0.1
0
0.1
0.2
0.3
0.4
0.5
Magnitude (dB 0 )

Normalized Frequency (cycles per sample)

16

The MLT Sine Window

The Modulated Lapped Transform (MLT) uses the sine window :

w(n) = sin n + 1 2

2M ,

π

n = 0, 1, 2,

, 2M 1 .

Used in MPEG-1, Layer 3 (MP3 format), MPEG-2 AAC, MPEG-4

Sidelobes 24 dB down

Asymptotically optimal coding gain

Zero-phase window transform (“truncated cosine

window”) has smallest moment of inertia over all

windows:

π

π

ω 2 W (ω)= min

17

Blackman-Harris Window Family

The Blackman-Harris family of windows is basically a generalization of the Hamming family.

In the case of the Hamming family, we constructed a summation of 3 shifted sinc functions.

The Blackman-Harris family is derived by considering a more general summation of shifted sinc functions:

w B (n) = w R (n)

L1

l=0

α l cos(lM n)

where M = 2π/M, n = (M 1)/2,

Special Cases:

(M 1)/2, (M odd).

L = 1 Rectangular

L = 2 Generalized Hamming

L = 3 Blackman Family

18

Frequency-Domain Implementation

The Blackman-Harris window family can be very efficiently implemented in the frequency domain as a (2L 1)-point convolution with the spectrum of the unwindowed data. Examples:

Start with a length M rectangular window

Take an M -point DFT

Convolve the DFT data with the 3-point smoother [1/4, 1/2, 1/4] to implement a Hann window

Note that the Hann window requires no multiplies in linear fixed-point data formats

Implement any Blackman window as a 5-point smoother in the frequency domain

19

Classic Blackman

The so-called “Blackman Window” is the specific case in which α 0 = 0.42 α 1 = 0.5, and α 2 = 0.08

Properties:

Sidelobes roll off about 18dB per octave (as T 0)

• −58dB sidelobe level (worst case)

One degree of freedom used to increase the roll-off rate from 6dB/octave to 18 dB per octave

One degree of freedom used to minimize sidelobes

One degree of freedom used to scale the window

Matlab:

N

=

101;

L

=

3;

No2

=

(N-1)/2;

n=-No2:No2;

ws

=

zeros(L,3*N);

z

=

zeros(1,N);

for

l=0:L-1

ws(l+1,:)

=

[z,cos(l*2*pi*n/N),z];

end

alpha

=

w

[0.42,0.5,0.08];

*

ws;

=

alpha

%

Classic

Blackman

20

Classic Blackman Window and Transform

Classic Blackman Window: M = 51

1 0.8 0.6 0.4 0.2 0 20 40 60 80 100 120 140 Amplitude
1
0.8
0.6
0.4
0.2
0
20
40
60
80
100
120
140
Amplitude

Time (samples)

0 −20 −40 −60 −80 −100 −120 100 200 300 400 500 600 700 800
0
−20
−40
−60
−80
−100
−120
100
200
300
400
500
600
700
800
900
1000
Magnitude (dB)

Frequency (bins)

21

Three-Term Blackman-Harris

Properties:

α 0 = 0.4243801 α 1 = 0.4973406, and α 2 = 0.0782793.

Side-lobe level 71.5 dB.

Side lobes roll off 6dB per octave in the absence of aliasing (like rectangular and Hamming).

All degrees of freedom (scaling aside) are used to minimize side lobes (like Hamming).

Matlab:

N

=

101;

L

=

3;

No2

=

(N-1)/2;

n=-No2:No2;

ws

=

zeros(L,3*N);

z

=

zeros(1,N);

for

l=0:L-1

ws(l+1,:)

=

[z,cos(l*2*pi*n/N),z];

end

% 3-term

alpha

w

Blackman-Harris(-Nuttall):

[0.4243801,

*

ws;

0.4973406,

0.0782793];

=

=

alpha

22

Three-Term Blackman-Harris Window and Transform

Three−Term Blackman−Harris Window: M = 51

1 0.8 0.6 0.4 0.2 0 20 40 60 80 100 120 140 Amplitude
1
0.8
0.6
0.4
0.2
0
20
40
60
80
100
120
140
Amplitude

Time (samples)

0 −20 −40 −60 −80 −100 −120 100 200 300 400 500 600 700 800
0
−20
−40
−60
−80
−100
−120
100
200
300
400
500
600
700
800
900
1000
Magnitude (dB)

Frequency (bins)

23

Amplitude

Longer Three-Term Blackman-Harris Window and Transform

Three−Term Blackman−Harris Window: M = 301

1

0.8

0.6

0.4

0.2

0

100 200 300 400 500 600 700 800 900
100 200
300
400
500
600
700
800
900

Time (samples)

0 −20 −40 −60 −80 −100 −120 200 400 600 800 1000 1200 1400 1600
0
−20
−40
−60
−80
−100
−120
200 400
600
800
1000
1200
1400
1600
Magnitude (dB)

Frequency (bins)

24

Power-of-Cosine

w(n) = w R (n) cos L πn ,

M

n

M 1

2

, M 1

2

L = 0, 1, 2,

first L terms of its Taylor expansion, evaluated at the endpoints are identically 0

roll-off rate 6(L + 1)dB/octave

L = 0 Rectangular window

L = 1 MLT sine window

L = 2 Hann window (“raised cosine” = “cos 2 ”)

L = 3 Alternate Blackman (max roll-off rate)

Thus, cos L windows parametrize Lth-order Blackman-Harris windows configured so as to use all L degrees of freedom to maximize roll-off rate.

25

Miscellaneous Windows

Bartlett (“Triangular”)

w(n) = w R (n) 1

|n| − 1)/2

(M

Convolution of two half-length rectangular windows

Window transform is sinc 2 =

First sidelobe twice as far down as rect (-26 dB)

Main lobe twice as wide as that of a rectangular window having the same length (same as that of a half-length rect used to make it)

Often applied to sample correlations of finite data

Also called the “tent function”

26

Poisson (“Exponential”)

w P (n) = w R (n)e α

|n|

(M 1)/2

where: α determines the time constant ( τ =

Poisson Window M = 51

M

2α

)

1 0.9 0.8 alpha = 1 0.7 0.6 0.5 0.4 0.3 0.2 alpha = 10
1
0.9
0.8
alpha = 1
0.7
0.6
0.5
0.4
0.3
0.2
alpha = 10
0.1
0
-20
-10
0
10
20
Amplitude

time (samples)

In the z-plane, the Poisson window has the effect of contracting the unit circle. Applied to a causal signal h(n) having z transform H(z), we have

27

H P (z) =

=

=

n=0

n=0

n=0

[w(n)h(n)]z n

h(n)e M/2 z n

αn

h(n)z n r n =

n=0

= H(zr)

(let r = e

α

M/2 )

h(n)(zr) n

z - plane r
z - plane
r

1

28

Hann-Poisson (“No Sidelobes”)

w(n) = 2 1 + cos π

1

1)/2 e α

n

(M

|n|

(M 1)/2

Poisson window times Hann window (exponential times raised cosine)

“No sidelobes” for α 2

Valuable for “hill climbing” optimization methods (gradient-based)

Matlab:

function

%HANNPOISSON

[w,h,p]

-

=

hannpoisson(M,alpha)

Length

M

Hann-Poisson

window

Mo2

=

(M-1)/2;

n=(-Mo2:Mo2)’;

scl

=

alpha

/

Mo2;

p =

scl2

exp(-scl*abs(n));

=

pi

/

Mo2;

h

=

0.5*(1+cos(scl2*n));

w

=

p.*h;

29

Hann-Poisson Window and Transform

Hann−Poisson Window, M = 21, Alpha = 2.0

1 0.8 0.6 0.4 0.2 0 −20 −15 −10 −5 0 5 10 15 20
1
0.8
0.6
0.4
0.2
0
−20
−15
−10
−5
0
5
10
15
20
Amplitude

Time (samples)

0 −10 −20 −30 −40 −3 −2 −1 0 1 2 3 Magnitude (dB)
0
−10
−20
−30
−40
−3
−2
−1
0
1
2
3
Magnitude (dB)

ωT

30

(radians per sample)

Hann-Poisson Slope and Curvature

Slope and Curvature of DTFT dB Magnitude, Hann−Poisson Window, M = 21, Alpha = 2.0

0.03 0.02 0.01 0 −0.01 −0.02 −0.03 −4 −3 −2 −1 0 1 2 3
0.03
0.02
0.01
0
−0.01
−0.02
−0.03
−4
−3
−2
−1
0
1
2
3
4
dB Magnitude Slope

ωT

(radians per sample)

5 x 10 −5 0 −5 −4 −3 −2 −1 0 1 2 3 4
5 x 10 −5
0
−5
−4
−3
−2
−1
0
1
2
3
4
dB Magnitude Curvature

31

ωT

(radians per sample)

Slope and Curvature for Larger Alpha

Slope and Curvature of DTFT dB Magnitude, Hann−Poisson Window, M = 21, Alpha = 3.0

0.02 0.01 0 −0.01 −0.02 −4 −3 −2 −1 0 1 2 3 4 dB
0.02
0.01
0
−0.01
−0.02
−4
−3
−2
−1
0
1
2
3
4
dB Magnitude Slope

ωT

(radians per sample)

2 x 10 −5 0 −2 −4 −4 −3 −2 −1 0 1 2 3
2 x 10 −5
0
−2
−4
−4
−3
−2
−1
0
1
2
3
4
dB Magnitude Curvature

32

ωT

(radians per sample)

Maximum Main-Lobe Energy Window: DPSS

Question: How do we use all M degrees of freedom (sample values) in an M -point window w(n) to obtain W (ω) δ(ω) in some optimal sense?

That is, we wish to perform the following optimization:

max

w

main lobe energy

total energy

In the continuous-time case [ω (−∞, )], this

problem is solved by a prolate spheroidal wave function, an eigenfunction of the integral equation

ω c

ω c

W(ν) sin(πD · (ω ν) π(ω ν)

= λW (ω)

where D is the nonzero time-duration of w(t) in seconds.

Interpretation:

FT(Chop D (IFT(Chop 2ω c (W )))) = λW

where Chop D (w) is a rectangular windowing operation which zeros w outside the interval t [D/2, D/2].

W is thus the bandlimited extrapolation of its main lobe.

The optimal window transform W is an eigenfunction of this operation sequence corresponding to the largest eigenvalue.

33

The resulting optimal window w has maximum main-lobe energy as a fraction of total energy.

It may be called the Slepian window, or prolate spheroidal window in the continuous-time case.

In discrete time, we need Discrete Prolate Spheroidal Sequences (DPSS), eigenvectors of the following symmetric Toeplitz matrix constructed from a sampled sinc function:

S[k, l] = ω c T(k k l l) ,

k, l = 0, 1, 2,

, M 1

M = window length in samples

ω c = main-lobe cut-off frequency (rad/sec)

T = sampling period in seconds.

The DPSS window (digital Slepian window) is then given by the eigenvector corresponding to the largest eigenvalue.

0.1 Matlab for the DPSS Window

function

[w,A,V]

=

dpssw(M,Wc);

%

DPSSW

-

Compute

Digital

Prolate

Spheroidal

Seq

%

(Slepian

window)

of

length

M,

having

c

34

%

Wc

in

(0,pi).

 

k

=

(1:M-1);

 

s

=

sin(Wc*k)./

k;

c0

=

[Wc,s];

 

A

=

toeplitz(c0);

%

c0=1st

col

of

symmetric

To

[V,evals]

=

eig(A);

%

Really

need

only

principal

[emax,imax]

=

max(abs(diag(evals)));

w = V(:,imax); w = w / max(w); 1 DPSS Kaiser 0.9 0.8 0.7 0.6
w
=
V(:,imax);
w
=
w
/
max(w);
1
DPSS
Kaiser
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0
10
20
30
40
50
60
70

Time (samples)

35

0 DPSS Kaiser Cutoff -20 -40 -60 -80 -100 -0.2 -0.15 -0.1 -0.05 0 0.05
0
DPSS
Kaiser
Cutoff
-20
-40
-60
-80
-100
-0.2
-0.15
-0.1
-0.05
0
0.05
0.1
0.15
0.2

Normalized Frequency (Hz)

DPSS window has a slightly narrower main lobe

DPSS window has lower overall side-lobe levels

Kaiser window side lobes roll off faster

Kaiser

Kaiser discovered an amazingly good approximation to

prolate spheroidal wave functions using Bessel functions:

   I 0 β 1

I 0 (β)

M/2 2

n

w K (n) =

,

  0,

This is called the Kaiser window.

36

M1

2

n M1

2

elsewhere

The Fourier transform of the Kaiser window is given by

W(ω k ) =

M

0 (β)

I

sinh β 2 Mω k

2

2

β 2 Mω k

2

2

where I 0 is a Bessel function of the first kind, and is equal to

k=0

(x/2) k k!

(x/2) k

I 0 (x) =

(Compare this with e x/2 =

k!

k=0

2

.)

Note: Sometimes you see the Kaiser window parameterized by α where β = πα.

37

SLL vs Main Lobe Width for the Kaiser Window ( =0,0.5,1,

,4)

−10 = = 0 −20 −30 −40 −50 −60 −70 −80 −90 = 4.0 −100
−10
=
= 0
−20
−30
−40
−50
−60
−70
−80
−90
= 4.0
−100
1
1.5
2
2.5
3
3.5
4
4.5
Side Lobe Level (SLL)

Main lobe width in units of rectangular−window main−lobe widths

β = c T is equal to 1/2 ‘time-bandwidth product’

α = ∆t · f

β trades off side lobe level for main lobe width larger β lower S.L.L., wider mainlobe

38

β = [0, 2, 4, 6, 8, 10]

Length 50 Kaiser windows, 6 betas between 0 and 10

1.2 = 0 1 0.8 = 2 = 10 0.6 0.4 = 4 0.2 0
1.2
= 0
1
0.8
= 2
= 10
0.6
0.4
= 4
0.2
0
0
5
10
15
20
25
30
35
40
45
50
Amplitude

Time (samples)

39

dB

dB

dB

dB

dB

dB

β = [0, 2, 4, 6, 8, 10]

Length 50 Kaiser windows, 6 betas between 0 and 10

0 = 0 −50 −100 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
0
= 0
−50
−100
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
0 0
Normalized Frequency (cycles per sample)
= 2
−50
−100
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
0 0
Normalized Frequency (cycles per sample)
= 4
−50
−100
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
0 0
Normalized Frequency (cycles per sample)
= 6
−50
−100
0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0 0 Normalized Frequency (cycles
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
0 0
Normalized Frequency (cycles per sample)
= 8
−50
−100
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
0 0
Normalized Frequency (cycles per sample)
= 10
−50
−100
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5

Normalized Frequency (cycles per sample)

40

dB

dB

dB

dB

M = [20, 30, 40, 50]

Kaiser window transforms, 4 window lengths between 20 and 50, beta=4

0

−20

−40

−60

0

−20

−40

−60

0

−20

−40

−60

0

−20

−40

−60

M = 20 0 0.05 0.1 0.15 0.2 0.25
M = 20
0 0.05
0.1
0.15
0.2
0.25
Normalized Frequency (cycles per sample) M = 30 0 0.05 0.1 0.15 0.2 0.25
Normalized Frequency (cycles per sample)
M = 30
0 0.05
0.1
0.15
0.2
0.25
Normalized Frequency (cycles per sample) M = 40 0 0.05 0.1 0.15 0.2 0.25
Normalized Frequency (cycles per sample)
M = 40
0 0.05
0.1
0.15
0.2
0.25
Normalized Frequency (cycles per sample) M = 50 0 0.05 0.1 0.15 0.2 0.25
Normalized Frequency (cycles per sample)
M = 50
0 0.05
0.1
0.15
0.2
0.25

Normalized Frequency (cycles per sample)

41

Kaiser Windows and Transforms

α = [1, 2, 3]

1 = 1 0.5 0 −50 0 50 Amplitude
1
= 1
0.5
0
−50
0
50
Amplitude

(β = [π, 2π, 3π])

0 = 1 −50 −100 −2 0 2 Magnitude (dB)
0
= 1
−50
−100
−2
0
2
Magnitude (dB)
Time (samples) ωT (radians per sample) 1 0 = 2 = 2 0.5 −50 0
Time (samples)
ωT
(radians per sample)
1
0
= 2
= 2
0.5
−50
0
−100
−50
0
50
−2
0
2
Amplitude
Magnitude (dB)
Time (samples) ωT (radians per sample) 1 0 = 3 = 3 0.5 −50 0
Time (samples)
ωT
(radians per sample)
1
0
= 3
= 3
0.5
−50
0
−100
−50
0
50
−2
0
2
Time (samples)
ωT
(radians per sample)
Amplitude
Magnitude (dB)

42

Dolph-Chebyshev

Minimize the Chebyshev norm of the side lobes:

min w sidelobes(W ) = min w {max ω>ω c |W(ω)|}

Alternatively, minimize main lobe width subject to a sidelobe spec:

max (ω c )

w

|W (ω) |≤ c α , ∀|ω|≥ω c

Closed-Form Window Transform (Dolph):

W(ω k ) = cos M cos 1 β cos πk

M

, (|k| ≤ M 1)

cosh M cosh 1 (β)

β

= cosh M cosh 1 (10 α ) ,

1

(α 2, 3, 4)

[Note error in text, which says “β = cosh 1 [· · · ]”]

Window w = IDFT(W ) [zero-centered case] or IDFT of (1) k W(ω k ) for causal case

α controls sidelobe level (“stopband ripple”):

Side-Lobe Level in dB = 20α.

smaller ripple larger ω c

see matlab function “chebwin(M,ripple)”

43

Dolph-Chebyshev Window, Length 31, Ripple -40 dB

Length 31 Chebyshev window

1 0.8 0.6 0.4 0.2 0 −25 −20 −15 −10 −5 0 5 10 15
1
0.8
0.6
0.4
0.2
0
−25
−20
−15
−10
−5
0
5
10
15
20
25
Amplitude

Time (samples)

10 0 −10 −20 −30 rip = 40.0 dB −40 −50 −60 −0.5 −0.4 −0.3
10
0
−10
−20
−30
rip = 40.0 dB
−40
−50
−60
−0.5
−0.4
−0.3
−0.2
−0.1
0
0.1
0.2
0.3
0.4
0.5
Magnitude (dB)

Normalized Frequency (cycles/sample)

44

Dolph-Chebyshev Window, Length 31, Ripple -200 dB

Length 31 Chebyshev window

1 0.8 0.6 0.4 0.2 0 −25 −20 −15 −10 −5 0 5 10 15
1
0.8
0.6
0.4
0.2
0
−25
−20
−15
−10
−5
0
5
10
15
20
25
Amplitude

Time (samples)

0 −50 −100 −150 rip = 200.0 dB −200 −250 −300 −0.5 −0.4 −0.3 −0.2
0
−50
−100
−150
rip = 200.0 dB
−200
−250
−300
−0.5
−0.4
−0.3
−0.2
−0.1
0
0.1
0.2
0.3
0.4
0.5
Magnitude (dB)

Normalized Frequency (cycles/sample)

45

Dolph-Chebyshev Window, Length 101, Ripple -40 dB

Length 101 Chebyshev window

1 0.8 0.6 0.4 0.2 0 −60 −40 −20 0 20 40 60 Amplitude
1
0.8
0.6
0.4
0.2
0
−60
−40
−20
0
20
40
60
Amplitude

Time (samples)

10 0 −10 −20 −30 rip = 40.0 dB −40 −50 −60 −0.5 −0.4 −0.3
10
0
−10
−20
−30
rip = 40.0 dB
−40
−50
−60
−0.5
−0.4
−0.3
−0.2
−0.1
0
0.1
0.2
0.3
0.4
0.5
Magnitude (dB)

Normalized Frequency (cycles/sample)

46

Dolph-Chebyshev and Hamming Windows Compared

DFT of Chebyshev and Hamming Window: M = 31, Ripple = −42 dB

0 Chebyshev Hamming −10 −20 −30 −40 −50 −60 −70 −3 −2 −1 0 1
0
Chebyshev
Hamming
−10
−20
−30
−40
−50
−60
−70
−3
−2
−1
0
1
2
3
Magnitude (dB)

Normalized Frequency (rad/sample)

For the comparison, we set the ripple parameter for chebwin to 42 dB:

window

=

[

chebwin(31,42)’

47

zeros(1,1024-31)

];

Gaussian

The Gaussian “bell curve” is the only smooth function that transforms to itself:

1

σ 2π e t 2 / 2σ 2 e ω 2 / 2(1) 2

/ 2 σ 2 ↔ e − ω 2 / 2(1 /σ ) 2 It also

It also achieves the minimum time-bandwidth product

σ t σ ω = σ × (1) = 1

when “width” of a function is defined as the square root of its second central moment. For even functions w(t),

σ t

=

t

2 w(t)dt.

−∞

Since the true Gaussian function has infinite duration, in practice we must window it with some finite window, or at least truncate it.

Philippe Depalle

suggests using a triangular window

raised to some power α for this purpose.

This choice preserves the absence of sidelobes for sufficiently large α. It also preserves non-negativity of the transform

48

The Gaussian Window in Spectral Modeling

Special Property: On a dB scale, the Gaussian is quadratic parabolic interpolation of a sampled Gaussian transform is exact.

Conjecture: Quadratic interpolation of spectral peaks is generally more accurate on a log-magnitude scale (e.g., dB) than on a linear magnitude scale. This has been verified in a number of cases, and no counter-examples are yet known. Exercise: Prove this is true for the rectangular window.

Matlab for the Gaussian Window

function

[w]

=

gausswin(M,sigma)

n=(-(M-1)/2:(M-1)/2)’;

w

exp(-n.*n./(2*sigma.*sigma));

=

49

Amplitude

Gaussian Window and Transform

1

0.8

0.6

0.4

0.2

0

Gaussian Window, M = 21, Sigma = M/8

−20 −15 −10 −5 0 5 10 15 20
−20
−15
−10
−5
0
5
10
15
20

Time (samples)

0 DTFT Parabola −20 −40 −60 −80 −100 −3 −2 −1 0 1 2 3
0
DTFT
Parabola
−20
−40
−60
−80
−100
−3
−2
−1
0
1
2
3
Magnitude (dB)

50

ωT

(radians per sample)

Optimal Windows

Generally we desire

W(ω) δ(ω)

Best results are obtained by formulating this as an FIR filter design problem.

In general, both time-domain and frequency-domain specifications are needed.

Equivalently, both magnitude and phase specifications are necessary in the frequency domain.

51

Optimal Windows for Audio Coding

Recently, numerically optimized windows have been developed by Dolby which achieve the following objectives:

Narrow the window in time

Smooth the onset and decay in time

Reduce sidelobes below the worst-case masking threshold

Windows in Graphics

1 http://www.cg.tuwien.ac.at/studentwork/CESCG99/TTheussl/paper.html

52

Conclusion

There is rarely a closed form expression for an optimal window in practice.

The hardest task is formulating the ideal error criterion.

Given an error criterion, it is usually straightforward to minimize it numerically with respect to the window samples w.

53