UNIT-2
FIR Filter Design
In practice it may be impossible to use all the terms of a Fourier series. For example, suppose we have a device that manipulates a periodic signal by first finding the Fourier series of the signal, then manipulating the sinusoidal components, and, finally, reconstructing the signal by adding up the modified Fourier series. Such a device will only be able to use a finite number of terms of the series.
Gibbs’ phenomenon occurs near a jump discontinuity in the signal. It says that no matter how many terms you include in your Fourier series there will always be an error in the form of an overshoot near the discontinuity.
The overshoot always be about 9% of the size of the jump. We illustrate with the example. of the square wave sq(t). The Fourier series of sq(t) fits it well at points of continuity. But there is always an overshoot of about .18 (9% of the jump of 2) near the points of discontinuity.
In these figures, for example, ’max n=9’ means we we included the terms for n = 1, 3, 5, 7 and 9 in the Fourier sum
2. Design an FIR lowpass using the windowing method such that
From the window characteristic we immediately see that for Hammering window will work.
To find M set
The cutoff frequency is
If a Kaiser window is desired, then for choose
The prescribed value for M should be
3. Assume that we need to implement the nine-tap FIR filter given by the following table using a cascade structure.
k | 4 | 3 and 5 | 2 and 6 | 1 and 7 | 0 and 8 |
0.3333 | 0.2813 | 0.1497 | 0 | -0.0977 |
Solution:
The system function of this filter is
It can be show
Where
4. Design a high-pass filter with fs=200Hz and fp=300Hz which exhibits attenuation greater than 40dB in the stop-band. We need the pass-band ripple to be less than 0.2dB. Assume that the sampling frequency, fsamp, is 1200Hz.
Solution:
we can find the pass-band ripple as 20log(1+δ1)−20log(1)=20log(1+δ1). In this example, 20log(1+δ1)=0.2dB, hence δ1=0.023.
The stop-band attenuation is −20log(δ2)=40dB which gives δ2 =0.01.
To find the angular frequencies, we need to normalize fs and fp with half the sampling frequency and multiply the result by π. Therefore, ωp=2πfp/ fsamp =0.5π and ωs = 0.33 π
Equating the transition band, 0.17π, with the main lobe width of the Hann window, we obtain M=47. An odd M will lead to a type II filter which is not suitable for high-pass and band-stop filters. As a result, we need to increase the filter length by one, i.e. M=48.
Using the equation describing a Hanning window, we find the window as
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 8,000 Hz using Hamming window
b) Determine the transfer function and difference equation of the designed FIR system.
c) plot the magnitude frequency response.
Solution:
The coefficients of the lowpass filter is c 2f cTs 2 800 / 8000 0.2
h0 0.2, h(1) h(1) 0.1871
For Hamming window with M = 3
w(n) 0.54 0.46 cosn w0 0.2, w(1) w(2) 0.01497 and for n = 0 ,1, 2 Then the windowed impulse response coefficients are h 0 1, h(1) h(2) 0.08
convert to z-domain
H(z) = 0.1497 + 0.2z-1 +0.1497z-2
Then the difference equation is
y(n) 0.01497x(n) 0.2x(n 1) 0.01497x(n 2).
6. A Digital Filter has frequency response () such that
Also let the sampling frequency be Fs 8 kHz. Determine the Passband and Stopband frequencies in kHz, the Passband ripple and the Stopband attenuation in dB.
Solution:
The passband ripple is given by 20 log10 1.05 0.42 dB, and the attenuation in the stopband 20 log10 0.005 46 dB.
The analog passband frequency is 0.3 Fs / 2 1.2 kHz and the stopband 0.4 Fs / 2 1.6 kHz
7. Design a low pass filter with passband Fp 2 kHz and stopband FS 2.5 kHz, with attenuation of at least 40dB. Let the sampling frequency be Fs 10 kHz. Using the techniques you know, determine the design with the least number of coefficients.
Solution:
8. Write the steps to design a LPF.