DSP Lab Report
DSP Lab Report
PROBLEM 2: CHEBYSHEV FILTER:
Using MATLAB design an IIR filter with passband edge frequency 1500Hz and stop band
edge at 2000Hz for a sampling frequency of 8000Hz, variation of gain within pass band 1 db
and stopband attenuation of 15 db. Use Chebyshev prototype design and Bilinear
Transformation.
DESIGN:
W1 = (2*pi* F1 )/ Fs = 2*pi*100)/4000 = 0.05 rad
W2 = (2*pi* F2 )/ Fs = 2*pi*500)/4000 =0.25 rad
Prewarp:
T=1sec
1 = 2/T tan (w1/2) = 0.157 rad/sec
2 = 2/T tan (w2/2) = 0.828 rad/sec
Order:
= 10
10
1
= 0.765
A= 10
-As/20
, A = 10
20/20
, A=10
g= (A2 - 1) / , g = 13.01
r= 2 / 1 r=0.828/0.157 = 5.27 rad\sec
n = log10 + ( ) / log10{r + (
) }
n= 1.388
Therefore n= 2. Cut-
off Frequency:
c = p = 1 = 0.157 rad\sec
Normalized Transfer Function:
H(s)=[bo / 1+
2
] / [ s
2
+b1s+b0]
= 0.505/[ s
2
+0.8s+0.036]
Denormalized Transfer Function:
H(s)= Hn(s) |s-s/c H(s)= Hn(s) |s-s/0.157
H(s) = 0.0125 / [s
2
+0.125s+0.057]
Apply BLT:
H(Z) = H(s)|
s=(2/T)[(1-z-1)/(1+z-1)]
H(Z) = 0.0125+0.025Z
-1
+ 0.0125 Z
-2
4.2769-7.96Z
-1
+ 3.76Z-2
H(Z) = 0.0029+0.0052Z
-1
+ 0.0029 Z
-2
1-1.86Z
-1
+ 0.88Z
-2
MATLAB CODE:
% Experiment 9B : Design of IIR Filter (Chebyshev Filter)
clear all; close all; clc;
% Accept Input Parameters from user
Rp = input('Enter Passband Attenuation in dB : ');
Rs = input('Enter Stopband Attenuation in dB : ');
fp = input('Enter Passband Frequency in Hz : ');
fs = input('Enter Stopband Frequency in Hz : ');
Fs = input('Enter Sampling Frequency in Hz : ');
% Calculate Sampled Frequency values
Wp=2* fp / Fs ;
Ws=2* fs / Fs ;
% Calculate Chebyshev filter order and cutoff Frequency:
% N = Minimum order of Filter Wn = Cutoff Frequencies
[N,Wn]=cheb1ord(Wp,Ws,Rp,Rs);
% Chebyshev Filter Design (z = zeros p = poles)
[z,p]=cheby1(N,Rp,Wn);
% Display Filter parameters :
disp('Order of Chebyshev Filter : ');
disp(N);
disp('Chebyshev Window Cutoff Frequency : ');
disp(Wn);
% Plot Frequency Response of Filter :
freqz(z,p);
title('Chebyshev Frequency response');
OUTPUT:
Enter Passband Attenuation in dB : 1
Enter Stopband Attenuation in dB : 15
Enter Passband Frequency in Hz : 1500
Enter Stopband Frequency in Hz : 2000
Enter Sampling Frequency in Hz : 8000
Order of Chebyshev Filter :
4
Chebyshev Window Cutoff Frequency :
0.3750