Professional Documents
Culture Documents
Matlab Code For Filters
Matlab Code For Filters
('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');