rp=input('enter
the passband ripple');
rs=input('enter
the stopband ripple');
wp=input('enter
the passband freq');
ws=input('enter
the stopband freq');
fs=input('enter
the sampling freq');
w1=2*wp/fs;
w2=2*ws/fs;
[n,wn]=buttord(w1,w2,rp,rs,'s');
[z,p,k]=butter(n,wn);
[b,a]=butter(n,wn,'s');
w=0:.01:pi;
[h,om]=freqs(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,2);
plot(im/pi,m);
ylabel('gain in
dB');
xlabel('Normalised
frequency');
subplot(2,1,2);
plot(om/pi,an);
xlabel('normalised
frequency');
ylabel('phase
in radians');
RESULT
enter the passband ripple 0.15
enter the stopband ripple 60
enter the passband freq 1500
enter the stopband freq 3000
enter the sampling freq 7000
No comments:
Post a Comment