RP 0.5000 Rs 40 PEF1 600 PEF2 1000 SEF1 400 SEF2 1200
RP 0.5000 Rs 40 PEF1 600 PEF2 1000 SEF1 400 SEF2 1200
clear all
close all
Rp=0.5
Rp = 0.5000
Rs=40
Rs = 40
PEF1=input('Pass Band Edge frequency 1:')
PEF1 = 600
PEF2=input('Pass Band Edge frequency 2:')
PEF2 = 1000
SEF1=input('Stop Band Edge frequency 1:')
SEF1 = 400
SEF2=input('Stop Band Edge frequency 2:')
SEF2 = 1200
fs=8000;
wp=[((PEF1))/(fs/2),((PEF2))/(fs/2)];
ws=[((SEF1))/(fs/2),((SEF2))/(fs/2)];
w=0:0.01:2*pi;
[N,Wc]=cheb2ord(wp,ws,Rp,Rs);
[b,a]=cheby2(N,Rp,wp,'bandpass');
[H,w0]=freqz(b,a,w);
Hdb=20*log10(abs(H));
subplot(2,1,1)
plot(w/pi,Hdb)
title('Band Pass Filter Chebyshev Type II')
xlabel('Normalized frequency')
ylabel('Magnitude in db')
subplot(2,1,2)
plot(w/pi,angle(H))
xlabel('Normalized frequency')
ylabel('Phase')
clc
clear all
close all
w=0:0.01:pi;
wc=0.3;
N=100;
[b]=fir1(N,wc,'low');
freqz(b,1,512)
title('LPF(Hamming Window)')
clc
clear all
close all
w=0:0.01:pi;
wc=0.4;
N=100;
L=rectwin(N+1);
[b]=fir1(N,wc,'high',L);
freqz(b,1,512)
title('HPF(Rectangular Window)')
clc
clear all
close all
w=0:0.01:pi;
wc=[0.3,0.7];
N=100;
L=hanning(N+1);
[b]=fir1(N,wc,'bandpass',L);
freqz(b,1,512)
title('Band Passs Filter(Hanning Window)')
clc
clear all
close all
w=0:0.01:pi;
wc=[0.3,0.7];
N=100;
L=blackman(N+1);
[b]=fir1(N,wc,'stop',L);
freqz(b,1,512)
title('Band stop Filter(Blackmann Window)')
clc
clear all
close all
w=0:0.01:pi;
wc=[0.4];
N=100;
L=kaiser(N+1);
[b]=fir1(N,wc,'high',L);
freqz(b,1,512)
title('High Pass Filter(Kaiser Window)')
clc
clear all
close all
w=0:0.01:pi;
wc=[0.3];
N=100;
L=chebwin(N+1);
wvtool(L)
[b]=fir1(N,wc,'low',L);
freqz(b,1,512)
title('Low Pass Filter(Blackmann Window)')