Beruflich Dokumente
Kultur Dokumente
Mirza
Lecture No. 22
Date: December, 2012
The Gibbs oscillations mainly result from the abrupt truncation of the infinite-length
coefficient sequence of impulse response of the FIR filter. A window function is a symmetrical
function which can gradually weight the designed FIR coefficients down to zeros at both ends
of for the range −𝑴 ≤ 𝒏 ≤ 𝑴. Applying the window sequence to the filter coefficients gives
where, 𝒘(𝒏) designates the window function. Commonly used window functions in FIR filters
are:
Lecture No. 22
Date: December, 2012
Example 7.5
(a) Calculate the filter coefficients for a 3-tap FIR lowpass filter with a cutoff frequency of
800 Hz and a sampling rate of 8000 Hz using the Hamming window function.
(b) Determine the transfer function and difference equation of the designed FIR system.
(c) Compute and plot the frequency response.
Solution
Part (a): We first determine the normalized cutoff frequency
𝟖𝟎𝟎
𝛀𝒄 = 𝟐𝝅 𝒇𝒄 𝑻𝒔 = 𝟐𝝅 × 𝟖𝟎𝟎𝟎 = 𝟎. 𝟐𝝅 radians
𝛀𝐜
, 𝒏=𝟎
𝒉(𝒏) = { 𝛑
sin(𝛀𝐜 𝒏)
−𝑴 ≤ 𝒏 ≤ 𝑴
𝝅𝒏
Therefore,
𝛀𝐜 𝟎. 𝟐𝝅
𝒉(𝟎) = = = 𝟎. 𝟐
𝝅 𝝅
sin(𝛀𝐜 ) sin(𝟎. 𝟐𝝅)
𝒉(𝟏) = = = 𝟎. 𝟏𝟖𝟕𝟏
𝝅 𝝅
𝒉(−𝟏) = 𝒉(𝟏) = 𝟎. 𝟏𝟖𝟕𝟏 (using symmetry)
Lecture No. 22
Date: December, 2012
It can be written as
Lecture No. 22
Date: December, 2012
Example 7.6
(a) Design a 5-tap FIR bandreject filter with a lower cutoff frequency of 2000 Hz, an upper
cutoff frequency of 2400 Hz and a sampling rate of 8000 Hz using the Hamming window
method.
(b) Determine the transfer function.
Solution
Part (a): We first determine the normalized cutoff frequencies
𝟐𝟎𝟎𝟎
𝛀𝑳 = 𝟐𝝅 𝒇𝑳 𝑻𝒔 = 𝟐𝝅 × 𝟖𝟎𝟎𝟎 = 𝟎. 𝟓𝝅 radians
𝟐𝟒𝟎𝟎
𝛀𝑯 = 𝟐𝝅 𝒇𝑯 𝑻𝒔 = 𝟐𝝅 × 𝟖𝟎𝟎𝟎 = 𝟎. 𝟔𝝅 radians
𝝅 − 𝛀𝑯 + 𝛀 𝑳
𝒏=𝟎
𝒉(𝒏) = { 𝝅
𝐬𝐢𝐧(𝛀𝑯 𝒏) 𝐬𝐢𝐧(𝛀𝑯 𝒏)
− + −𝟐 ≤ 𝒏 ≤ 𝟐
𝒏𝝅 𝒏𝝅
Therefore,
Lecture No. 22
Date: December, 2012
𝝅 − 𝛀𝑯 + 𝛀𝑳 𝝅 − 𝟎. 𝟔𝝅 + 𝟎. 𝟓𝝅
𝒉(𝟎) = = = 𝟎. 𝟗
𝝅 𝝅
𝐬𝐢𝐧(𝛀𝑯 ) 𝐬𝐢𝐧(𝛀𝑯 ) 𝐬𝐢𝐧(𝟎. 𝟔𝝅) 𝐬𝐢𝐧(𝟎. 𝟓𝝅)
𝒉(𝟏) = − + =− + = 𝟎. 𝟎𝟏𝟓𝟓𝟖
𝝅 𝝅 𝝅 𝝅
𝐬𝐢𝐧(𝟐𝛀𝑯 ) 𝐬𝐢𝐧(𝛀𝑯 𝟐) 𝐬𝐢𝐧(𝟏. 𝟐𝝅) 𝐬𝐢𝐧(𝝅)
𝒉(𝟐) = − + =− + = 𝟎. 𝟎𝟗𝟑𝟓𝟓
𝟐𝝅 𝟐𝝅 𝝅 𝝅
𝒉(−𝟏) = 𝒉(𝟏) = 𝟎. 𝟎𝟏𝟓𝟓𝟖 (using symmetry)
𝟎×𝝅
𝒘𝒉𝒂𝒎 (𝟎) = 𝟎. 𝟓𝟒 + 𝟎. 𝟒𝟔 𝐜𝐨𝐬 ( ) = 𝟏. 𝟎
𝟐
𝟏×𝝅
𝒘𝒉𝒂𝒎 (𝟏) = 𝟎. 𝟓𝟒 + 𝟎. 𝟒𝟔 𝐜𝐨𝐬 ( ) = 𝟎. 𝟓𝟒
𝟐
𝟐×𝝅
𝒘𝒉𝒂𝒎 (𝟐) = 𝟎. 𝟓𝟒 + 𝟎. 𝟒𝟔 𝐜𝐨𝐬 ( ) = 𝟎. 𝟎𝟖
𝟐
𝒘𝒉𝒂𝒎 (−𝟏) = 𝒘𝒉𝒂𝒎 (𝟏) = 𝟎. 𝟓𝟒 (using symmetry)
𝒘𝒉𝒂𝒎 (−𝟐) = 𝒘𝒉𝒂𝒎 (𝟐) = 𝟎. 𝟎𝟖 (using symmetry)
Lecture No. 22
Date: December, 2012
𝜹𝒑 𝒅𝑩 = 𝟐𝟎 ∙ log 10 (𝟏 + 𝜹𝒑 )
Table 7.7: Filter length estimation using window (∆𝒇 = |𝒇𝒔𝒕𝒐𝒑 − 𝒇𝒑𝒂𝒔𝒔 |/𝒇𝒔 )
Stopband
Window Window Window Passband Attenuation
Type Function 𝒘(𝒏), −𝑴 ≤ 𝒏 ≤ 𝑴 Length Ripple (dB) (dB)
Rectangular 𝟏 𝑵 = 𝟎. 𝟗/∆𝒇 0.7416 21
𝒏𝝅
Hanning 𝟎. 𝟓 + 𝟎. 𝟓 𝐜𝐨𝐬 ( ) 𝑵 = 𝟑. 𝟏/∆𝒇 0.0546 44
𝑴
𝒏𝝅
Hamming 𝟎. 𝟓𝟒 + 𝟎. 𝟒𝟔 𝐜𝐨𝐬 ( ) 𝑵 = 𝟑. 𝟑/∆𝒇 0.0194 53
𝑴
𝒏𝝅 𝟐𝒏𝝅
Blackman 𝟎. 𝟒𝟐 + 𝟎. 𝟓 𝐜𝐨𝐬 ( ) + 𝟎. 𝟎𝟖 𝐜𝐨𝐬 ( ) 𝑵 = 𝟓. 𝟓/∆𝒇 0.0017 74
𝑴 𝑴
Lecture No. 22
Date: December, 2012
Example 7.10
Design a bandpass FIR filter with the following specifications:
Lower Stopband = 0 - 500 Hz
Passband = 1600 - 2300 Hz
Upper Stopband = 3500 - 4000 Hz
Stopband Attenuation = 50 dB
Passband ripple = 0.05dB
Sampling rate = 8000 Hz
Determine the FIR filter length and the cutoff frequency to be used in the design equation.
Solution
We first determine the normalized transition band
|𝟏𝟔𝟎𝟎 − 𝟓𝟎𝟎|
∆𝒇𝟏 = = 𝟎. 𝟏𝟑𝟕𝟓
𝟖𝟎𝟎𝟎
|𝟑𝟓𝟎𝟎 − 𝟐𝟑𝟎𝟎|
∆𝒇𝟐 = = 𝟎. 𝟏𝟓
𝟖𝟎𝟎𝟎
The filter lengths based on above transition bands (for Hamming window) are
𝟑. 𝟑
𝑵𝟏 = = 𝟐𝟒
𝟎. 𝟏𝟑𝟕𝟓
𝟑. 𝟑
𝑵𝟐 = = 𝟐𝟐
𝟎. 𝟏𝟓
The nearest higher odd 𝑵 is chosen as for the Hamming window
𝑵 = 𝟐𝟓
The lower and higher cutoff frequencies for the bandpass filter will be
𝟏𝟔𝟎𝟎 + 𝟓𝟎𝟎
𝒇𝟏 = = 𝟏𝟎𝟓𝟎 𝑯𝒛
𝟐
𝟑𝟓𝟎𝟎 + 𝟐𝟑𝟎𝟎
𝒇𝟏 = = 𝟐𝟗𝟎𝟎 𝑯𝒛
𝟐
The normalized lower and higher cutoff frequencies for the bandpass filter will be
𝟏𝟎𝟓𝟎
𝛀𝑳 = 𝟐𝝅 𝒇𝑳 𝑻𝒔 = 𝟐𝝅 × = 𝟎. 𝟐𝟔𝟐𝟓𝝅 𝐫𝐚𝐝𝐢𝐚𝐧𝐬
𝟖𝟎𝟎𝟎
𝟐𝟗𝟎𝟎
𝛀𝑯 = 𝟐𝝅 𝒇𝑯 𝑻𝒔 = 𝟐𝝅 × = 𝟎. 𝟕𝟐𝟓𝝅 𝐫𝐚𝐝𝐢𝐚𝐧𝐬
𝟖𝟎𝟎𝟎
In this case 𝟐𝑴 + 𝟏 = 𝟐𝟓 will be the number of taps for the bandpass filter.
Lecture No. 22
Date: December, 2012
Lecture No. 22
Date: December, 2012