BUTTERWORTH HIGH PASS FILTER
alphap=.4; %Passband attenuation in db
alphas=30; %stopband attenuation in db
fs=400; %stopband frequency in hz
fp=800; %passband frequency in hz
F=2000;
omp=2*fp/F;oms=2*fs/F;
%To find cutoff frequency and order of the filter
[n,wn]=buttord(omp,oms,alphap,alphas);
%system function of the filter
[b,a]=butter(n,wn,'high');
w=0:.01:pi;
[h,om]=freqz(b,a,w);
m=20*log(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
grid;
ylabel('Gain in db');
xlabel('Normalised frequency');
subplot(2,1,2);
plot(om/pi,an);
grid;
ylabel('Phase in radians');
xlabel('Normalised frequency');
0 comments:
Post a Comment