700 likes | 1k Views
I IR Filter. Signal and System. Filbert H. Juwono. Wireless and Signal Processing (WaSP) Research Group Department of Electrical Engineering University of Indonesia www.ee.ui.ac.id/wasp. State of the art. The basic IIR filter is characterized by the following equation :
E N D
IIR Filter Signal and System Filbert H. Juwono Wireless and Signal Processing (WaSP) Research Group Department of Electrical Engineering University of Indonesia www.ee.ui.ac.id/wasp
State of the art • The basic IIR filter is characterized by the following equation : • Where h(k) is the impulse response of the filter which is theoretically infinite in duration
bkand akare the coefficients of the filter • x(n) and y(n) are the input and output to the filter • Transfer function for the IIR filter is :
Zeros are those values of z which H(z) becomes zero Poles are values of z for which H(z) is infinite
The important thing is to find suitable values for the coefficients bkand ak • Note that the current output y(n) is a function of the past outputs y(n-k) . So that it show the feedback system of some sort • The strength of IIR filters comes from the flexibility the feedback arrangement provides • Remember that the transfer function of IIR filter can be shown as the pole and zero equations
For frequency selective filters, such as lowpass and bandpass filters, the frequency response specifications are often in the form of tolerance scheme • Here is an example tolerance scheme for an IIR bandpass filter
ε2 : passband ripple parameter δp : passband deviation δs : stopband deviation fp1 and fp2 : passband edge frequency fp1 and fp2 : stopband edge frequency • Ap : passband ripple = 10. log10(1+ ε2) = 20. log10(1- δp) As : stopband attenuation = -20. log10(δs) The band edge frequencies are sometimes given in normalized form, that is a fraction of the sampling frequency
Coefficient calculation methods for IIR filters There are 4 methods to calculate the coefficients : • Pole-zero placement • Impulse invariant • Matched z-transform • Bilinear z-transform Learn carefully
Pole-zero placement Method • The idea is : when a zero is placed at a given point on the z-plane, the frequency response will be zero at the corresponding point while a pole produces a peak at the corresponding frequency point • Note that for the coefficient of the filter to be real, the poles and zeros must either be real
Example • A bandpass digital filter which is required to meet the following specifications : - complete signal rejection at dc and 250 Hz - a narrow passband centered at 125 Hz - a 3dB bandwidth of 10 Hz Assume the sampling frequency of 500 Hz
Solution Fist we must determine where to place the poles and zeros on the z-plane . Watch the frequency on 250 Hz and 125 Hz Zeros are at angles of 0o and 360o x 250/500 = 180o and the place poles at +- 360o x 125/500 = +-90o The radius, r, of the poles is determined by the desi- red bandwidth. An approximate relationship between r , for r > 0.9 and bandwidth bw is given by : r = 1 – (bw/Fs).π So that, by substituting the value of bw=10 Hz and Fs=500 Hz , giving r = 0.937 After it, we can draw the pole-zero diagram below :
From the pole-zero diagram, the transfer function can be written as follow :
So that, the difference equation is : Look at again the transfer function. It shows filter which is a second-order section, with coefficients : b0 = 1 a1 = 0 b1 = 0 a2 = 0.877969 b2 = -1
Converting analogue filters into equivalent digital filters • This represents the most successful approach of obtaining the coefficients of IIR filters • Two common approaches: • The impulse invariant • The matched z-transform • The bilinear z-transform
Impulse Invariant Method • First, consider these component : - H (s) : a suitable analog transfer function - h (t ) : the impulse response - h (nT) : z transforming with T sampling interval - H (z) : desired transfer function • Those component are useful and obtained by using Laplace Transform and also z-transformation
Illustrating The Impulse Invariant Method • Digitize, using the impulse invariant method, the simple analogue filter with the transfer function given by:
The impulse response of the equivalent digital filter • The transfer function of H(z) is obtained by z-transforming h(nT)
We can write • So
For the case when M = 2 • If the poles are conjugates, then
Here are the steps in Impulse Invariant Method : • Determine a normalized analog filter H(s) that satisfies the specifications for the desired digital filter • If necessary, expand H(s) using partial fraction to simplify the next step • Obtain the z-transform of each partial fraction to obtain :
4. Obtain H(z) by combining the z-transforms of the partial fractions into second-order terms and possibly one-first-order term. If the actual sampling frequency is used then multiply H(z) by T
Example • It is required to design a digital filter to approximate the following normalized analogue transfer function • Assumed a 3 dB cutoff frequency of 150 Hz and a sampling • frequency of 1.28 kHz
Solution • We need to scale the normalized transfer function • This is achieved by replacing s by s/α, where • Thus
To keep the gain down and to avoid overflows when the filter is implemented, it is common to multiply H(z) by T or divide it by the sampling frequency
Matched z-transform (MZT) method • It provides a simple way to convert an analog filter into an equivalent digital filter • The idea is : each of the poles and zeros of the analog filter is mapped directly from the s-plane to the z-plane using the following equation : • It maps a pole or zero at the location s=a in the s-plane, onto a pole or zero in the z-plane at z=eaT
In case where M = N =2 and the poles and zeros are conjugates
Example • Having a filter with a 3 dB cutoff frequency of 150 Hz in sampling frequency of 1.28 kHz. The normalized of transfer function of an analog filter is given by :
The cutoff frequency may be expressed as ωc= 2π x 150 = 942.4778 rad/s . The transfer function of the denormalized analog filter is obtained by repla- cing s by s/ωc : Find poles by abc formula
Remember : so that : We have the real and imaginary poles :
Then, prT = -0.52065 cos (piT) = 0.8675 piT = +0.52065 e prT = 0.5941 The transfer function become :
Bilinear z-transform (BZT) Method • It is the most important method • The idea is: to convert an analog filter H(s) into an equivalent digital filter is to replace s as follow: • That transformation maps the analog transfer function, H(s), from the s-plane into the discrete transfer function, H(z), in the z-plane
Look at the figure below. It shows the transforma-tion using BZT method S-plane Z-plane
Direct replacement of s in H(s) may lead to a digital filter with undesirable response • We find that the analogue frequency ω’ and the digital frequency ω are related as • We can see that ω’ and ω are almost linear for small values of ω, but becomes not linear for large values of ω, leading to distortion (warping)
This effect is compensated by prewarping tha analogue filter before applying the bilinear transformation
Here are the steps for using BZT • Use the digital filter specifications to find suitable normalized, prototype, analog low pass filter H(s) • Determine and prewarpe the bandedge or critical frequencies of the desired filter when : ωp = specified cutoff frequency ωp’ = prewarped cutoff frequency
Remember that in bandpass and bandstop filter, there are the lower and upper passband edge frequencies or we can say ωp1’ and ωp2’ . 3. Denormalize the analog prototype filter by replacing s in the transfer function, H(s), using these following transformation :
lowpass to lowpass lowpass to highpass lowpass to bandpass lowpass to bandstop
4. Apply the BZT to obtain the desired digital filter transfer function, H(z), by replacing s in the frequency-scaled (i.e. denormalized) transfer function, H’(s) as follows
Example • Determine the transfer function and the difference equation for the digital equivalent of the analogue lowpass filter transfer function • Assume a sampling frequency of 150 Hz and a cutoff frequency of 30 Hz
Solution • The critical frequency • The cutoff frequency after prewarping • With T = 1/150 Hz, so
Denormalized analogue filter • The difference equation
When it transfers into highpass filter • Simplifying
Classical Analog Filter • There are four types of Classical Analog filter : • Butterworth filter • Chebysev type I • Chebysev type II • Elliptic • All types of filter are derived from lowpass prototype filter
Butterworth Filter Here is sketch of frequency response on Butterworth filter
The important equations on Butterworth filter are : Magnitude square Frequency response Filter order