Laboratory Exercise DIGITAL FILTER DESIGN 7.1 DESIGN OF IIR FILTERS Project 7.1 Estimation of IIR Filter Order Answers: π 2π The normalized stopband edge angular frequency Ws is Q7.1 The normalized passband edge angular frequency Wp is - The desired passband ripple Rp is - 0.5 dB The desired stopband ripple Rs is - 40 dB (1) Using these values and buttord we get the lowest order for a Butterworth lowpass filter to be - 10 The corresponding normalized passband edge frequency Wn is – 0.7067 (2) Using these values and cheb1ord we get the lowest order for a Type Chebyshev lowpass filter to be - The corresponding normalized passband edge frequency Wn is – 0.6283 (3) Using these values and cheb2ord we get the lowest order for a Type Chebyshev lowpass filter to be - The corresponding normalized passband edge frequency Wn is – 1.2067 (4) Using these values and ellipord we get the lowest order for an elliptic lowpass filter to be - From the above results we observe that the ellipord filter has the lowest order meeting the specifications 3π 12π The normalized stopband edge angular frequency Ws is 35 Q7.2 The normalized passband edge angular frequency Wp is - The desired passband ripple Rp is - dB The desired stopband ripple Rs is - 50 dB (1) Using these values and buttord we get the lowest order for a Butterworth highpass filter to be - 12 The corresponding normalized passband edge frequency Wn is 1.7402 (2) Using these values and cheb1ord we get the lowest order for a Type Chebyshev highpass filter to be - The corresponding normalized passband edge frequency Wn is 1.8850 (3) Using these values and cheb2ord we get the lowest order for a Type Chebyshev highpass filter to be - The corresponding normalized passband edge frequency Wn is -1.2049 (4) Using these values and ellipord we get the lowest order for an elliptic highpass filter to be - From the above results we observe that the ellipord filter has the lowest order meeting the specifications 2π 3π , 5 3π 7π The normalized stopband edge angular frequency Ws is , 10 Q7.3 The normalized passband edge angular frequency Wp is - The desired passband ripple Rp is – 0.4 dB The desired stopband ripple Rs is – 50 dB (1) Using these values and buttord we get the lowest order for a Butterworth bandstop filter to be – 25; 45 The corresponding normalized passband edge frequent Wn is – 1.1865 ; 19351 (2) Using these values and cheb1ord we get the lowest order for a Type Chebyshev bandstop filter to be – 10 ; 14 The corresponding normalized passband edge frequency Wn is – 1.2566 ;1.885 (3) Using these values and cheb2ord we get the lowest order for a Type Chebyshev bandstop filter to be – 10 ; 14 The corresponding normalized passband edge frequency Wn is – 0.9633 ; 2.171 (4) Using these values and ellipord we get the lowest order for an elliptic bandstop filter to be – ; From the above results we observe that the ellipord filter has the lowest order meeting the specifications Q7.4 The normalized passband edge angular frequency Wp is - 3π The normalized stopband edge angular frequency Ws is - 7π , 20 9π 13π , 10 20 The desired passband ripple Rp is – 0.6 dB The desired stopband ripple Rs is – 45 dB (1) Using these values and buttord we get the lowest order for a Butterworth bandpass filter to be – 5; 32 The corresponding normalized passband edge frequency Wn is – 1.4172; 2.2747 (2) Using these values and cheb1ord we get the lowest order for a Type Chebyshev bandpass filter to be – ;10 The corresponding normalized passband edge frequency Wn is – 1.096; 2.3562 (3) Using these values and cheb2ord we get the lowest order for a Type Chebyshev bandpass filter to be – ; 10 The corresponding normalized passband edge frequency Wn is – 2.1663; 2.0701 (4) Using these values and ellipord we get the lowest order for an elliptic bandpass filter to be – ; From the above results we observe that the ellipord filter has the lowest order meeting the specifications Project 7.2 IIR Filter Design A copy of Program P7_1 is given below: % Program P7_1 % Design of a Butterworth Bandstop Digital Filter Ws = [0.4 0.6]; Wp = [0.2 0.8]; Rp = 0.4; Rs = 50; % Estimate the Filter Order [N1, Wn1] = buttord(Wp, Ws, Rp, Rs); % Design the Filter [num,den] = butter(N1,Wn1,'stop'); % Display the transfer function disp('Numerator Coefficients are ');disp(num); disp('Denominator Coefficients are ');disp(den); % Compute the gain response [g, w] = gain(num,den); % Plot the gain response plot(w/pi,g);grid axis([0 -60 5]); xlabel('\omega /\pi'); ylabel('Gain in dB'); title('Gain Response of a Butterworth Bandstop Filter'); Answers: Q7.5 The coefficients of the Butterworth bandstop transfer function Gain Response of a Butterworth Bandstop Filter generated by running -10 The exact expression for the -20 Gain in dB Program P7_1 are as follows: transfer function is – dải triệt The gain response of the -30 -40 filter as designed is given -50 below: -60 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 ω /π From the plot we conclude that the design bandstop the specifications The plot of the unwrapped phase response and the group delay response of this filter is given below: 0 0 0 0 0 Q7.6 The coefficients of the Type Chebyshev lowpass transfer function for the parameters given in Question 7.1 and generated by running modified Program P7_1 are as follows: The exact expression for the transfer function is – thông thấp The gain response of the filter as designed is given below: G a i n R e s p o n s e o fa B u t t e r w o r t h B a n d s t o p F il t e r G a i n in d B 0 / ω π From the plot we conclude that the design lowpass the specifications The plot of the unwrapped phase response and the group delay response of this filter is given below: 0 0 0 0 Q 7.7 The coefficients of the Type Chebyshev highpass transfer function for the parameters given in Question 7.2 and generated by running modified Program P7_1 are as follows: The exact expression for the transfer function is – thông cao The gain response of the filter as designed is given below: G a in R e s p o n s e o fa B u t te r w o r t h B a n d s to p F ilte r G a in in d B 0 / ω π From the plot we conclude that the design highpass the specifications The plot of the unwrapped phase response and the group delay response of this filter is given below: 0 0 0 0 Q7.8 The coefficients of the elliptic bandpass transfer function for the parameters given in Question 7.3 and generated by running modified Program P7_1 are as follows: The exact expression for the transfer function is – thông dải The gain response of the filter as designed is given below: G a inR e s p o n s eo f aB u tte r w o r thB a n d s to pF ilte r G a inind B 0 /π ω From the plot we conclude that the design bandpass the specifications The plot of the unwrapped phase response and the group delay response of this filter is given below: 0 0 0 0