Anda di halaman 1dari 13

The Rectangular Window

MUS421/EE367B Lecture 3 In Lecture 0, we looked at the rectangular window:


FFT Windows
(
∆ 1, |n| ≥ M2−1
wR (n) =
Julius O. Smith III (jos@ccrma.stanford.edu) 0, otherwise
Center for Computer Research in Music and Acoustics (CCRMA)
Zero−Phase Rectangular Window − M = 21
Department of Music, Stanford University
Stanford, California 94305 1

March 28, 2005


0.8

Outline

Amplitude
0.6

• Rectangular, Hann, Hamming 0.4

• MLT Sine
0.2

• Blackman-Harris Window Family


• Kaiser 0
−20 −15 −10 −5 0
Time (samples)
5 10 15 20

• Chebyshev
The window transform was found to be
• Bartlett sin M ω2 ∆
WR (ω) =  = M · asincM (ω) (1)
• Poisson sin ω2
• Gaussian where asincM (ω) denotes the aliased sinc function.
∆ sin(M ω/2)
• Optimal Windows asincM (ω) =
M · sin(ω/2)
1 2

This result is plotted below: More generally, we may plot both the magnitude and
DFT of a Rectangular Window of length M = 11
phase of the window versus frequency:
12

DFT of a Rectangular Window − M = 11


10
11

8 10

9
6
Amplitude

8
4

7
2
Amplitude

0
5

−2 4

−4 3
−3 −2 −1 0 1 2 3
Normalized Frequency ω (rad/sample)
2

PSfrag replacements 1

Note that this is the complete window transform, not just ω/Ω
−3 −2 −1 0 1 2 3
M Normalized Frequency ω (rad/sample)

its magnitude. We obtain real window transforms like this


only for symmetric, zero-phase windows. Phase of Rectangular Window Transform (M = 11)
3.5343

3.1416

2.7489

2.3562

1.9635
Phase (rad)

1.5708

1.1781

0.7854

0.3927

PSfrag replacements 0
Main Lobe

−0.3927
−3 −2 −1 0 1 2 3
ω/ΩM Normalized Frequency ω (rad/sample)

3 4
In audio work, we more typically plot the window Since the DTFT of the rectangular window approximates
transform magnitude on a decibel (dB) scale: 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 = 11
0
DFT of a Rectangular Window − M = 20
0

−5
−6.0206
main lobe Ideal −6 dB per octave line

−10 −12.0412
13 dB down
−18.0618 Partial
−15
Main
Magnitude (dB)

sidelobes sidelobes −24.0824 Lobe

Amplitude (dB)
−20
−30.103

−25 −36.1236

−42.1442
−30

−48.1648
−35
−54.1854
eplacements nulls nulls PSfrag replacements
−40
−3 −2 −1 0 1 2 3 0.1 0.2 0.4 0.8 1.6 3.2 6.4
(radians per sample) Normalized Frequency ω (rad/sample) ωT (radians per sample) 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.

5 6

Sidelobe Roll-Off Rate In summary, the DTFT of the M -sample rectangular


window is proportional to the ‘aliased sinc function’:
In general, if the first n derivatives of a continuous ∆ sin(ωM T /2)
function w(t) exist (i.e., they are finite and uniquely asincM (ωT ) =
M · sin(ωT /2)
defined), then its Fourier Transform magnitude is
asymptotically proportional to sin(πf M T ) ∆
≈ = sinc(f M T )
constant M πf T
|W (ω)| → (as ω → ∞)
ω n+1
Proof: Papoulis, Signal Analysis, McGraw-Hill, 1977 Some important points:
∆ 2π
Thus, we have the following rule-of-thumb: • Zero crossings at integer multiples of ΩM = M

n derivatives ↔ −6(n + 1) dB per octave roll-off rate where ΩM = 2π
M = frequency sampling interval for a
(since −20 log10(2) = 6.0205999 . . .). length M DFT
This is also −20(n + 1) dB per decade. • Main lobe width is 2ΩM = 4π
M
To apply this result, we normally only need to look at the • As M gets bigger, the mainlobe narrows
window’s endpoints. The interior of the window is usually (better frequency resolution)
differentiable of all orders.
• M has no effect on the height of the side lobes
Examples: (Same as the “Gibbs phenomenon” for Fourier series)
• Amplitude discontinuity ↔ −6 dB/octave roll-off • First sidelobe only 13 dB down from main-lobe peak
• Slope discontinuity ↔ −12 dB/octave roll-off • Side lobes roll off at approximately 6dB per octave
• Curvature discontinuity ↔ −18 dB/octave roll-off • A phase term arises when we shift the window to
For discrete-time windows, the roll-off rate slows down at make it causal, while the window transform is real in
high frequencies due to aliasing. the zero-phase case (i.e., centered about time 0)

7 8
Generalized Hamming Window Family In terms of the rectangular window transform
WR (ω) = M · asincM (ω) (zero-phase, unit-amplitude
case), this can be written as:
Consider the following picture in the frequency domain:

WH (ω) = αWR(ω) + βWR (ω − ΩM ) + βWR (ω + ΩM )
0.5

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

0.2 wH = αwR(n) + βe−jΩM n + βejΩM nwR(n)


wR(n)
Amplitude

2πn
0.1 = wR (n) α + 2β cos
M
0

Choosing various parameters for α and β result in


eplacements −0.1
different windows in the generalized Hamming family,
ΩM some of which have names.
−0.2
−2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.5
ω/Ω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 10

Hann or Hanning or Raised Cosine Hann window properties:

• Mainlobe is 4ΩM wide


The Hann window is defined by the settings α = 1/2 and
β = 1/4: • 1st side lobe is at -31dB
• Side lobes roll off at approx. 18dB / octave
   
1 1 2 ΩM
wH (n) = wR(n) + cos(ΩM n) = wR (n) cos n
2 2 2
Hamming
Hann Window, M = 21
1

0.8 This window is determined by optimizing over α and β in


such a way as to reduce the worst-case side lobe level.
Amplitude

0.6

0.4
Doing this, results in the following values:
0.2

0
−20 −15 −10 −5 0 5 10 15 20
• α = .54
Time (samples)
• β = (1 − α)/2 (for unit time-domain peak amplitude)
0
−10
−20
Magnitude (dB)

−30 −31.5 dB

−40

eplacements −50
−60

(radians per sample) −70


−3 −2 −1 −2ΩM+1 0 2Ω 1 2 3
Hann M+1
Normalized Frequency (rad/sample)

11 12
Hamming Window Hamming Window Properties

1
Hamming Window, M = 21
• Discontinuous “slam to zero” at endpoints
0.8
• main lobe is 4ΩM
Amplitude

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

0.2 • 1st side lobe is improved over Hann


0
−20 −15 −10 −5 0 5 10 15 20 • side lobes closer to “equal ripple”
Time (samples)

0
Note: The Hamming window could also be called the
−10
−20
“Chebyshev Generalized Hamming Window”. This is
Magnitude (dB)

−30 because the Hamming window minimizes the sidelobe


−40 −40.6 dB

−50
level within the family. Chebyshev-type designs generally
−60 exhibit equiripple error behavior, since the worst-case
eplacements −70
error (sidelobe level in this case) is minimized.
−3 −2 −1 −2ΩM−1 0 2Ω
M−1
1 2 3
(radians per sample) Normalized Frequency (rad/sample)

13 14

Longer Hamming Window Window Transform Summary

Hamming Window, M = 101


1 Window Transforms, Window length = 20
0
0.8 Rectangular
Magnitude (dB0)

−10
−20
Amplitude

0.6 −30
−40
0.4
−50
−60
0.2 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
Normalized Frequency (cycles per sample)
0
0
−100 −80 −60 −40 −20 0 20 40 60 80 100 Hanning
Magnitude (dB0)

−10
Time (samples)
−20
−30
0 −40
−10 −50
−20 −60
Magnitude (dB)

−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
−30 Normalized Frequency (cycles per sample)
0
−40 −42.7 dB Hamming
Magnitude (dB0)

−10
−50 −20
−60 −30
eplacements −70
−40
−50
−3 −2 −1 −2Ω2Ω0
M−1M−1
1 2 3
(radians per sample) −60
Normalized Frequency (rad/sample) −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
Normalized Frequency (cycles per 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 16
The MLT Sine Window Blackman-Harris Window Family

The Modulated Lapped Transform (MLT) uses the sine


window : • The Blackman-Harris family of windows is basically a
   generalization of the Hamming family.
1 π
w(n) = sin n + , n = 0, 1, 2, . . . , 2M − 1 . • In the case of the Hamming family, we constructed a
2 2M
summation of 3 shifted sinc functions.
• Used in MPEG-1, Layer 3 (MP3 format),
• The Blackman/Harris family is derived by considering
MPEG-2 AAC, MPEG-4
a more general summation of shifted sinc functions:
• Sidelobes 24 dB down L−1
X
• Asymptotically optimal coding gain wB (n) = wR(n) αl cos(lΩM n)
l=0


where ΩM = 2π/M ,
n = −(M − 1)/2, . . . (M − 1)/2 (M odd).

Special Cases:
• L = 1 ⇒ Rectangular
• L = 2 ⇒ Generalized Hamming
• L = 3 ⇒ Blackman Family

17 18

Frequency-Domain Implementation Classic Blackman

The Blackman-Harris window family can be very The so-called “Blackman Window” is the specific case in
efficiently implemented in the frequency domain as a which α0 = 0.42 α1 = 0.5, and α2 = 0.08
(2L − 1)-point convolution with the spectrum of the Properties:
unwindowed data. Examples:
• Sidelobes roll off about 18dB per octave (as T → 0)
• Start with a length M rectangular window
• −58dB sidelobe level (worst case)
• Take an M -point DFT
• One degree of freedom used to increase the roll-off
• Convolve the DFT data with the 3-point smoother rate from 6dB/octave to 18 dB per octave
[1/4, 1/2, 1/4] to implement a Hann window
• One degree of freedom used to minimize sidelobes
• Note that the Hann window requires no multiplies in
linear fixed-point data formats • One degree of freedom used to scale the window
• Implement any Blackman window as a 5-point Matlab:
smoother in the frequency domain
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 = [0.42,0.5,0.08]; % Classic Blackman
w = alpha * ws;

19 20
Classic Blackman Window and Transform Three-Term Blackman-Harris

1
Classic Blackman Window: M = 51 Properties:
0.8
• α0 = 0.4243801 α1 = 0.4973406, and
Amplitude

0.6
α2 = 0.0782793.
0.4

0.2
• Side-lobe level 71.48 dB.
0
20 40 60 80 100 120 140
• Side lobes roll off ≈ 6dB per octave in the absence of
Time (samples)
aliasing (like rectangular and Hamming).
0
• All degrees of freedom (scaling aside) are used to
−20
minimize side lobes (like Hamming).
Magnitude (dB)

−40

−60

−80
Matlab:
−100

−120
100 200 300 400 500 600 700 800 900 1000
N = 101; L = 3; No2 = (N-1)/2; n=-No2:No2;
Frequency (bins)
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 Blackman-Harris(-Nuttall):
alpha = [0.4243801, 0.4973406, 0.0782793];
w = alpha * ws;

21 22

Three-Term Blackman-Harris Window and Longer Three-Term Blackman-Harris Window


Transform and Transform

Three−Term Blackman−Harris Window: M = 51 Three−Term Blackman−Harris Window: M = 301


1 1

0.8 0.8
Amplitude
Amplitude

0.6 0.6

0.4 0.4

0.2 0.2

0 0
20 40 60 80 100 120 140 100 200 300 400 500 600 700 800 900
Time (samples) Time (samples)

0 0

−20 −20
Magnitude (dB)
Magnitude (dB)

−40 −40

−60 −60

−80 −80

−100 −100

−120 −120
100 200 300 400 500 600 700 800 900 1000 200 400 600 800 1000 1200 1400 1600
Frequency (bins) Frequency (bins)

23 24
Power-of-Cosine Miscellaneous Windows

 πn    Bartlett (“Triangular”)
L M −1 M −1
w(n) = wR (n) cos , n∈ − ,
M 2 2
 
|n|
• L = 0, 1, 2, . . . w(n) = wR (n) 1 −
(M − 1)/2
• first L terms of its Taylor expansion, evaluated at the
endpoints are identically 0 • Convolution of two half-length rectangular windows
• roll-off rate ≈ 6(L + 1)dB/octave • Window transform is sinc2 =⇒
• L = 0 ⇒ Rectangular window • First sidelobe twice as far down as rect (-26 dB)
• L = 1 ⇒ MLT sine window • Main lobe twice as wide as that of a rectangular
• L = 2 ⇒ Hann window (“raised cosine” = “cos ”) 2 window having the same length
(same as that of a half-length rect used to make it)
• L = 3 ⇒ Alternate Blackman (max roll-off rate)
• Often applied to sample correlations of finite data
L
Thus, cos windows parametrize Lth-order • Also called the “tent function”
Blackman-Harris windows configured so as to use all L
degrees of freedom to maximize roll-off rate.

25 26

Poisson (“Exponential”)

X
HP (z) = [w(n)h(n)]z −n
n=0
|n|
−α (M −1)/2 ∞ h
wP (n) = wR(n)e X αn
− M/2
i
∆ α

M
= h(n)e z −n (let r = e M/2 )
where: α determines the time constant ( τ = 2α ) n=0

X ∞
X
1
Poisson Window M = 51 = h(n)z −nr−n = h(n)(zr)−n
n=0 n=0
0.9

0.8 alpha = 1
= H(zr)
0.7

0.6
Amplitude

0.5
z - plane
0.4

0.3

0.2 alpha = 10

0.1

0
-20 -10 0 10 20
time (samples)

r 1

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 28
Hann-Poisson (“No Sidelobes”) Hann-Poisson Window and Transform

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

1 n −α
|n| 1

w(n) = 1 + cos π e (M −1)/2 0.8


2 (M − 1)/2

Amplitude
0.6

• Poisson window times Hann window 0.4

(exponential times raised cosine) 0.2

• “No sidelobes” for α ≥ 2 0


−20 −15 −10 −5 0 5 10 15 20
Time (samples)

• Valuable for “hill climbing” optimization methods 0

(gradient-based)
−10

Magnitude (dB)
Matlab: −20

−30
function [w,h,p] = hannpoisson(M,alpha) PSfrag replacements
%HANNPOISSON - Length M Hann-Poisson window −40
−3 −2 −1 0 1 2 3
ωT (radians per sample)

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


scl = alpha / Mo2;
p = exp(-scl*abs(n));
scl2 = pi / Mo2;
h = 0.5*(1+cos(scl2*n));
w = p.*h;

29 30

Hann-Poisson Slope and Curvature Slope and Curvature for Larger Alpha

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

0.02
dB Magnitude Slope

dB Magnitude Slope

0.01
0.01

0 0

−0.01
−0.01
−0.02

−0.03 −0.02
−4 −3 −2 −1 0 1 2 3 4 −4 −3 −2 −1 0 1 2 3 4
ωT (radians per sample) ωT (radians per sample)
−5 −5
x 10 x 10
5 2
dB Magnitude Curvature

dB Magnitude Curvature

−2

eplacements PSfrag replacements


−5 −4
−4 −3 −2 −1 0 1 2 3 4 −4 −3 −2 −1 0 1 2 3 4
ωT (radians per sample) ωT (radians per sample)

31 32
Kaiser r !
 2
M ωk
sinh β2 − 2
Question: How do we use all M degrees of freedom M
W (ωk ) = r
(sample values) in an M -point window w(n) to obtain I0(β) 
M ωk
2
W (ω) ≈ δ(ω) in some optimal sense? β2 − 2

The Kaiser window maximizes the energy in the main where I0 is a Bessel function of the first kind, and is
lobe of the window. equal to
∞  2

X (x/2)k

main lobe energy
 I0(x) =
max k!
k=0
w total energy ∞
X (x/2)k
The functions which maximize this ratio are known as (Compare this with ex/2 = .)
k!
prolate spheroidal wave functions. k=0
Note: Sometimes you see the Kaiser window
Kaiser discovered an approximation based upon Bessel ∆
functions: parameterized by α where β = πα
 r  2
!
 I0 β 1− M/2
 n

wK (n) = I0 (β) , − M2−1 ≤ n ≤ M2−1

 0, elsewhere

The transform of this window is:

33 34

SLL vs Main Lobe Width for the Kaiser Window (α=0,0.5,1,...,4)


−10
α=β=0

−20
β = [0, 2, 4, 6, 8, 10]
−30 Length 50 Kaiser windows, 6 betas between 0 and 10
1.2
−40
Side Lobe Level (SLL)

β=0
−50
1

−60

−70 0.8

−80 β=2 β = 10
Amplitude

−90 0.6
α = 4.0
−100
1 1.5 2 2.5 3 3.5 4 4.5
Main lobe width in units of rectangular−window main−lobe widths
0.4

β=4
• β is equal to 1/2 ‘time-bandwidth product’ 0.2

• β trades off side lobe level for main lobe width


larger β ⇒ lower S.L.L., wider mainlobe 0
0 5 10 15 20 25 30 35 40 45 50
Time (samples)

35 36
β = [0, 2, 4, 6, 8, 10] M = [20, 30, 40, 50]
Length 50 Kaiser windows, 6 betas between 0 and 10 Kaiser window transforms, 4 window lengths between 20 and 50, beta=4
0 0
β=0
dB

−50 −20 M = 20

dB
−100 −40
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
0
Normalized Frequency (cycles per sample) β=2 −60
0 0.05 0.1 0.15 0.2 0.25
dB

−50
0 Normalized Frequency (cycles per sample)
−100
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 −20 M = 30
0
β=4

dB
Normalized Frequency (cycles per sample)
−40
dB

−50

−100 −60
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0 0.05 0.1 0.15 0.2 0.25
0 Normalized Frequency (cycles per sample)
Normalized Frequency (cycles per sample) β=6 0
dB

−50
−20 M = 40

dB
−100
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 −40
0
Normalized Frequency (cycles per sample) β=8
−60
dB

−50 0 0.05 0.1 0.15 0.2 0.25


0 Normalized Frequency (cycles per sample)
−100
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
0 −20 M = 50
Normalized Frequency (cycles per sample) β = 10

dB
dB

−50 −40

−100 −60
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0 0.05 0.1 0.15 0.2 0.25
Normalized Frequency (cycles per sample) Normalized Frequency (cycles per sample)

37 38

Kaiser Windows and Transforms Chebyshev

Minimize the Chebyshev norm of the side lobes:



α = [1, 2, 3] (β = [π, 2π, 3π]) minw k sidelobes(W ) k∞ = minw {maxω>ωc |W (ω)|}

1 0
Alternatively, minimize main lobe width subject to a
α=1 α=1 sidelobe spec:
Magnitude (dB)
Amplitude


0.5 −50
max(ωc)

w |W (ω) |≤ cα , ∀|ω|≥ωc
0 −100
−50 0
Time (samples)
50 −2 0 2
ωT (radians per sample) Closed-Form Window Transform:
cos M cos−1 β cos πk
1 0
  
α=2 α=2 M
Magnitude (dB)

W (ωk ) = , (|k| ≤ M − 1)
Amplitude

cosh M cosh−1(β)
 
0.5 −50
 
1
0 −100 β = cosh cosh−1(10α) , (α ≈ 2, 3, 4)
−50 0
Time (samples)
50 −2 0 2
ωT (radians per sample)
M
[Note error in text, which says “β = cosh−1[· · · ]”]
1 0
α=3 α=3
Magnitude (dB)
Amplitude

0.5 −50
• Window w = IDFT(W ) [zero-phase case]
eplacements or IDFT of (−1)k W (ωk ) for causal case
0 −100
−50 0 50 −2 0 2
Time (samples) ωT (radians per sample) • α controls sidelobe level (“stopband ripple”):
Side-Lobe Level in dB = −20α.
• smaller ripple ⇒ larger ωc
• see matlab function “chebwin(M,ripple)”
• also called the Dolph-Chebyshev Window
39 40
Chebyshev Window, Length 31, Ripple -40 dB Chebyshev Window, Length 31, Ripple -200 dB

Length 31 Chebyshev window Length 31 Chebyshev window


1 1

0.8 0.8

Amplitude
Amplitude

0.6 0.6

0.4 0.4

0.2 0.2

0 0
−25 −20 −15 −10 −5 0 5 10 15 20 25 −25 −20 −15 −10 −5 0 5 10 15 20 25
Time (samples) Time (samples)

10 0
0 −50

Magnitude (dB)
−10
Magnitude (dB)

−100
−20
−150
−30
rip = 200.0 dB
rip = 40.0 dB −200
−40
−250
−50

−60 −300
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
Normalized Frequency (cycles/sample) Normalized Frequency (cycles/sample)

41 42

Chebyshev Window, Length 101, Ripple -40 dB Chebyshev and Hamming Windows Compared

Length 101 Chebyshev window DFT of Chebyshev and Hamming Window: M = 31, Ripple = −42 dB
1 0

0.8
Chebyshev
Hamming
−10
Amplitude

0.6

0.4
−20

0.2

−30
Magnitude (dB)

0
−60 −40 −20 0 20 40 60
Time (samples)

−40
10

0
−50
−10
Magnitude (dB)

−20

−30 −60
rip = 40.0 dB
−40

−50 −70
−60
PSfrag replacements
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
−3 −2 −1 0 1 2 3
Normalized Frequency (cycles/sample)
ωT (radians per sample) Normalized Frequency (rad/sample)

For the comparison, we set the ripple parameter for


chebwin to 42 dB:

window = [ chebwin(31,42)’ zeros(1,1024-31) ];

43 44
Gaussian The Gaussian Window in Spectral Modeling

The Gaussian “bell curve” is the only smooth function Special Property: On a dB scale, the Gaussian is
that transforms to itself: quadratic ⇒ parabolic interpolation of a sampled
1 2 2 2 2 Gaussian transform is exact.
√ e−t /2σ ↔ e−ω /2(1/σ)
σ 2π Conjecture: Quadratic interpolation of spectral peaks
It also achieves the minimum time-bandwidth product is generally more accurate on a log-magnitude scale (e.g.,
dB) than on a linear magnitude scale. This has been
σtσω = σ × (1/σ) = 1 verified in a number of cases, and no counter-examples
when “width” of a function is defined as the square root are yet known. Exercise: Prove this is true for the
of its second central moment. For even functions w(t), rectangular window.
sZ


σt = t2w(t)dt.
−∞
Matlab for the Gaussian Window
• Since the true Gaussian function has infinite duration,
in practice we must window it with some finite
window, or at least truncate it. function [w] = gausswin(M,sigma)

• Philippe Depalle suggests using a triangular window n=(-(M-1)/2:(M-1)/2)’;


raised to some power α for this purpose. w = exp(-n.*n./(2*sigma.*sigma));
• This choice preserves the absence of sidelobes for
sufficiently large α.
• It also preserves non-negativity of the transform

45 46

Gaussian Window and Transform Optimal Windows

1
Gaussian Window, M = 21, Sigma = M/8 Generally we desire
0.8 W (ω) ≈ δ(ω)
Amplitude

0.6

0.4
• Best results are obtained by formulating this as an
0.2
FIR filter design problem.
0
−20 −15 −10 −5 0 5 10 15 20
• In general, both time-domain and frequency-domain
Time (samples)
specifications are needed.
0
DTFT
Parabola
• Equivalently, both magnitude and phase
−20
specifications are necessary in the frequency domain.
Magnitude (dB)

−40

−60

−80
eplacements
−100
−3 −2 −1 0 1 2 3
ωT (radians per sample)

47 48
Optimal Windows for Audio Coding Conclusion

Recently, numerically optimized windows have been


• There is rarely a closed form expression for an optimal
developed by Dolby which achieve the following
window in practice.
objectives:
• The hardest task is formulating the ideal error
• Narrow the window in time criterion.
• Smooth the onset and decay in time • Given an error criterion, it is usually straightforward
• Reduce sidelobes below the worst-case masking to minimize it numerically with respect to the window
threshold samples w.

Windows in Graphics

On Windowing for Gradient Estimation in Volume Visualization 1

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

49 50

Anda mungkin juga menyukai