BUTTERWORTH BAND REJECT FILTER
alphap=2; %Passband attenuation in dB
alphas=20; %stopband attenuation in dB
ws=[.2,.4]; %stopband frequency in radians
wp=[.1,.5]; %Passband frequency in radians
%To find cutoff frequency and order of the filter
[n,wn]=buttord(wp,ws,alphap,alphas);
%system function of filter
[b,a]=butter(n,wn,'stop');
w=0:.01:pi;
[h,ph]=freqz(b,a,w);
m=20*log(abs(h));
an=angle(h);
subplot(2,1,1);
plot(ph/pi,m);
grid;
ylabel('Gain in dB');
xlabel('Normalised frequency');
subplot(2,1,2);
plot(ph/pi,an);
grid;
ylabel('Phase in radians');
xlabel('Normalised frequency');
1 comments:
Hi... Can anyone help me with butterworth filter design without using library functions in MATLAB?
Post a Comment