Fixed Window Functions Fixed Window Functions • Using a tapered window causes the height of the sidelobes to diminish, with a corresponding increase in the main lobe width resulting in a wider transition at the discontinuity • Hann: w[ n] = 0.5 + 0.5 cos( 2π n ), − M ≤ n ≤ M 2M + 1 • Hamming: w[ n] = 0.54 + 0.46 cos( 2π n ), − M ≤ n ≤ M 2M + 1 • Blackman: w[n] = 0.42 + 0.5 cos( 2π n ) + 0.08 cos( 4π n ) 2M + 1 2M + 1 • Plots of magnitudes of the DTFTs of these windows for M = 25 are shown below: Fixed Window Functions Fixed Window Functions • Magnitude spectrum of each window characterized by a main lobe centered at ω = 0 followed by a series of sidelobes with decreasing amplitudes • Parameters predicting the performance of a window in filter design are: • Main lobe width • Relative sidelobe level • Main lobe width ∆ ML - given by the distance between zero crossings on both sides of main lobe • Relative sidelobe level Asl - given by the difference in dB between amplitudes of largest sidelobe and main lobe Copyright © 2001, S. K. Mitra Hanning window 0 -20 -20 Gain, dB Gain, dB Rectangular window 0 -40 -60 -60 -80 -80 -100 0 -40 0.2 0.4 0.6 0.8 -100 1 0 0.2 0 0.2 0 0 -20 -20 Gain, dB Gain, dB ω/π Hamming window -40 -60 -80 -100 0.4 0.6 0.8 ω/π Blackman window -40 -60 -80 0 0.2 0.4 0.6 0.8 1 -100 ω/π Copyright © 2001, S. K. Mitra Fixed Window Functions 1 0.4 0.6 0.8 1 ω/π Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Fixed Window Functions • Distance between the locations of the maximum passband deviation and minimum stopband value ≅ ∆ ML • Observe H t (e j ( ωc + ∆ω) ) + H t (e j ( ωc − ∆ω) ) ≅ 1 • Thus, H t (e jωc ) ≅ 0.5 • Passband and stopband ripples are the same Copyright © 2001, S. K. Mitra • Width of transition band ∆ω = ω s − ω p < ∆ ML Copyright © 2001, S. K. Mitra 1 Fixed Window Functions Fixed Window Functions • To ensure a fast transition from passband to stopband, window should have a very small main lobe width • To reduce the passband and stopband ripple δ , the area under the sidelobes should be very small • Unfortunately, these two requirements are contradictory • In the case of rectangular, Hann, Hamming, and Blackman windows, the value of ripple does not depend on filter length or cutoff frequency ωc , and is essentially constant • In addition, ∆ω ≈ c M where c is a constant for most practical purposes Copyright © 2001, S. K. Mitra Fixed Window Functions • Rectangular window - ∆ ML = 4π /( 2 M + 1) Asl = 13.3 dB, α s = 20.9 dB, ∆ω = 0.92π / M • Hann window - ∆ ML = 8π /( 2 M + 1) Asl = 31.5 dB, α s = 43.9 dB, ∆ω = 3.11π / M • Hamming window - ∆ ML = 8π /( 2 M + 1) Asl = 42.7 dB, α s = 54.5 dB, ∆ω = 3.32π / M • Blackman window - ∆ ML = 12π /(2 M + 1) Asl = 58.1 dB, α s = 75.3 dB, ∆ω = 5.56π / M Copyright © 2001, S. K. Mitra FIR Filter Design Example • Lowpass filter of length 51 and ω c = π / 2 Lowpass Filter Designed Using Hamming window 0 Gain, dB -50 -50 -100 -100 0 0.2 0.4 0.6 0.8 0 1 0.2 0.4 0.6 0.8 1 ω/π ω/π Lowpass Filter Designed Using Blackman window 0 Gain, dB Gain, dB Lowpass Filter Designed Using Hann window 0 Copyright © 2001, S. K. Mitra Fixed Window Functions • Filter Design Steps (1) Set ω c = (ω p + ω s ) / 2 (2) Choose window based on specified α s (3) Estimate M using ∆ω ≈ c M Copyright © 2001, S. K. Mitra FIR Filter Design Example • An increase in the main lobe width is associated with an increase in the width of the transition band • A decrease in the sidelobe amplitude results in an increase in the stopband attenuation -50 -100 0 0.2 0.4 0.6 ω/π 0.8 1 Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra 2 Adjustable Window Functions Adjustable Window Functions • Dolph-Chebyshev Window M w[n ] = 1 [γ1 + 2 å Tk ( β cos k ) cos 2nkπ ], 2M + 1 2M + 1 2M + 1 k =1 −M ≤n≤M amplitude of sidelobe where γ= main lobe amplitude β = cosh( 1 cosh −1 γ1 ) 2M and ì cos(l cos −1 x ), x ≤1 Tl ( x) = í −1 îcosh(l cosh x), x > 1 • Dolph-Chebyshev window can be designed with any specified relative sidelobe level while the main lobe width adjusted by choosing length appropriately • Filter order is estimated using 2.056α s − 16.4 N= 2.85(∆ω ) where ∆ω is the normalized transition bandwidth, e.g, for a lowpass filter ∆ω = ωs − ω p Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Adjustable Window Functions Adjustable Window Functions • Gain response of a Dolph-Chebyshev window of length 51 and relative sidelobe level of 50 dB is shown below Properties of Dolph-Chebyshev window: • All sidelobes are of equal height • Stopband approximation error of filters designed have essentially equiripple behavior • For a given window length, it has the smallest main lobe width compared to other windows resulting in filters with the smallest transition band Dolph-Chebyshev Window Gain, dB 0 -20 -40 -60 -80 0 0.2 0.4 0.6 0.8 1 ω/π Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Adjustable Window Functions Adjustable Window Functions • Kaiser Window I {β 1 − ( n / M ) 2 } w[ n] = 0 , −M ≤n≤ M I0 ( β ) where β is an adjustable parameter and I 0 (u ) is the modified zeroth-order Bessel function of the first kind: ∞ (u / 2) r I 0 (u ) = 1 + å [ ]2 r! r =1 • Note I 0 (u ) > 0 for u > 0 20 (u / 2) r • In practice I 0 (u ) ≅ 1 + å [ ]2 r! r =1 • β controls the minimum stopband attenuation of the windowed filter response • β is estimated using Copyright © 2001, S. K. Mitra 0.1102( α s −8.7 ), for α s > 50 ìï β=í0.5842( α s − 21)0.4 + 0.07886( α s − 21), for 21 ≤ α s ≤ 50 0, ïî for α s < 21 • Filter order is estimated using N= αs − 8 2.285(∆ω ) where ∆ω is the normalized transition bandwidth Copyright © 2001, S. K. Mitra 3 FIR Filter Design Example • Choose N = 24 implying M =12 FIR Filter Design Example sin(0.4π n) • Hence ht [ n] = ⋅ w[n], − 12 ≤ n ≤ 12 πn where w[n] is the n-th coefficient of a length-25 Kaiser window with β = 3.3953 0 -20 -20 Gain, dB 0 -40 0.2 0.4 0.6 ω/π Impulse Responses of FIR Filters with a Smooth Transition • First-order spline passband-to-stopband transition ω c = (ω p + ω s ) / 2 ∆ω = ωs − ω p ωc / π , ìï hLP [ n] = í 2 sin( ∆ω n / 2) sin(ω c n) ⋅ πn ïî ∆ω n n=0 -40 -60 -60 -80 0 Copyright © 2001, S. K. Mitra Lowpass filter designed with Kaiser window Kaiser Window Gain, dB • Specifications: ω p = 0.3π , ω s = 0.5π , α s = 40 dB • Thus ω c = (ω p + ω s ) / 2 = 0.4π δ s = 10−α s / 20 = 0.01 β = 0.5842(19) 0.4 + 0.07886 × 19 = 3.3953 32 N= = 22.2886 2.285(0.2π) 0.8 1 -80 0 0.2 0.4 0.6 0.8 1 ω/π Copyright © 2001, S. K. Mitra Impulse Responses of FIR Filters with a Smooth Transition • Pth-order spline passband-to-stopband transition ωc / π , ì ï hLP [ n] = íæ 2 sin( ∆ω n / 2 P ) ö P sin(ω c n) ç ÷ ⋅ πn ï îè ∆ω n / 2 P ø n=0 n >0 n >0 Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Lowpass FIR Filter Design Example • Example Magnitude 1 P = 1, N = 40 P = 2, N = 60 0.8 0.6 0.4 0.2 0 0 0.2 0.4 0.6 0.8 1 ω/π Copyright © 2001, S. K. Mitra 4