My filter is not working. I am using version 2018 A

#Frequency responses using the rectangular and Hamming windows.
N=25;Ftype=1;WnL= 0:5*pi;WnH=0;Wtype=1;fs=8000;
%Design using the rectangular window;
Brec=firwd(N,Ftype,WnL,WnH,Wtype);
N=25;Ftype=1;WnL= 0:5*pi;WnH=0;Wtype=4;
%Design using the Hamming window;
Bham=firwd(N,Ftype,WnL,WnH,Wtype);
[hrec,f]=freqz(Brec,1,512,fs);
[hham,f]=freqz(Bham,1,512,fs);
prec= 180*unwrap(angle(hrec))/pi;
pham= 180*unwrap(angle(hham))/pi
subplot(2,1,1);
plot(f,20*log10(abs(hrec)),0-.0,f,20*log10(abs(hham)));grid
axis([0 4000 -100 10]);
xlabel('Frequency (Hz)');ylabel('Magnitude Response (dB)');
subplot(2,1,2);
plot(f,prec,0-.0,f,pham);grid
xlabel('Frequency (Hz)');ylabel('Phase (degrees)');

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!