You are on page 1of 1

MATLAB CODE FOR FILTERS clc; close all; fp=input ('enter the lower cut off frequency'); fs=input

('enter the upper cut off frequency'); Fs=input('enter sampling frequency'); rp=input('enter passband ripple'); rs=input('enter stopband ripple'); wp=fp/Fs; ws=fs/Fs; [N,Wn]=cheb1ord (wp,ws,rp,rs); [b,a]=cheby1 (N,rp[wp,ws],'band pass'); %[b,a]=cheby1(N,rp,Wn,'high'); %for high pass and low pass [n,omega]=freqz(b,a,256); plot(omega/pi,20*log10(abs(n)));grid; xlabel ('omega/pi'); ylabel('gain,db'); title ('type|cheby highpassfilter');

You might also like