Experiment 7[1]
Experiment 7[1]
Experiment 7[1]
clear all
close all
w1=2*wp/fs;
w2=2*ws/fs;
[n,wn]=cheb1ord(w1,w2,rp,rs);
[b,a]=cheby1(n,rp,wn);
w=0:0.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
title('magnitude response');
xlabel('normalisd frequency............>');
ylabel('gain in db...............>');
grid on;
subplot(2,1,2);
plot(om/pi,an);
title('phase response');
ylabel('phase in radians..........>');
grid on;
Experiment -8(d): Bandstop filter:
clc
clear all
close all
w1=2*wp/fs;
w2=2*ws/fs;
[n]=cheb1ord(w1,w2,rp,rs);
wn=[w1 w2];
[b,a]=cheby1(n,rp,wn,'stop');
w=0:0.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
title('magnitude response');
xlabel('normalisd frequency............>');
ylabel('gain in db...............>');
grid on;
subplot(2,1,2);
plot(om/pi,an);
title('phase response');
ylabel('phase in radians..........>');
grid on;