Chebyshev Filter: All All 'Enter Passband Ripple' 'Enter Stopband Ripple'
Chebyshev Filter: All All 'Enter Passband Ripple' 'Enter Stopband Ripple'
clc; clear all; close all; rp=input('Enter Passband Ripple'); rs=input('Enter Stopband Ripple'); %LPF chebyshev BILINEAR wp=0.3; ws=0.6; [n,wn]=cheb1ord(wp,ws,rp,rs); [num,den]=cheby1(n,rp,wn,'low'); disp(num); disp(den); w=0:0.01:pi; [h,w]=freqz(num,den,w); mag=20*log10(abs(h)); subplot(4,2,1); plot(w/pi,mag); grid on; title('IIR cheb mag rep lpf'); xlabel('normalised freq'); ylabel('gain in db'); an=angle(h); subplot(4,2,2); plot(w/pi,an); grid on; title('IIR cheb phase rep'); xlabel('normalised freq'); ylabel('angle in dp'); %hPF chebyshev BILINEAR ws=0.6; wp=0.3; [n,wn]=cheb1ord(wp,ws,rp,rs); [num,den]=cheby1(n,rp,wn,'high'); disp(num); disp(den); w=0:0.01:pi; [h,w]=freqz(num,den,w); mag=20*log10(abs(h)); subplot(4,2,3); plot(w/pi,mag); grid on; title('IIR cheb mag rep hpf'); xlabel('normalised freq');
ylabel('gain in db'); an=angle(h); subplot(4,2,4); plot(w/pi,an); grid on; title('IIR cheb phase rep'); xlabel('normalised freq'); ylabel('angle in dp'); %bPF chebyshev BILINEAR wp=[0.2,0.4]; ws=[0.1,0.5]; [n,wn]=cheb1ord(wp,ws,rp,rs); [num,den]=cheby1(n,rp,wn,'bandpass'); disp(num); disp(den); w=0:0.01:pi; [h,w]=freqz(num,den,w); mag=20*log10(abs(h)); subplot(4,2,5); plot(w/pi,mag); grid on; title('IIR cheb mag rep bpf'); xlabel('normalised freq'); ylabel('gain in db'); an=angle(h); subplot(4,2,6); plot(w/pi,an); grid on; title('IIR cheb phase rep'); xlabel('normalised freq'); ylabel('angle in db'); %BSF chebysher BILINEAR wp=[0.2,0.4]; ws=[0.1,0.5]; [n,wn]=cheb1ord(wp,ws,rp,rs); [num,den]=cheby1(n,rp,wn,'stop'); disp(num); disp(den); w=0:0.01:pi; [h,w]=freqz(num,den,w); mag=20*log10(abs(h)); subplot(4,2,7); plot(w/pi,mag); grid on;
title('IIR cheb mag rep bsf'); xlabel('normalised freq'); ylabel('gain in dB'); an=angle(h); subplot(4,2,8); plot(w/pi,an); grid on; title('IIR cheb phase rep'); xlabel('normalised freq'); ylabel('angle in dB');