Show ur work Design a band pass FIR filter. Using Blackman window to design a FI
ID: 3546745 • Letter: S
Question
Show ur work
Design a band pass FIR filter. Using Blackman window to design a FIR band pass filter with Fs=8192hz and cut off frequency Fc1=500Hz and Fc2=3500Hz. You choose the order 10 of the filter. Generate an M-file. Using the designed filter to filter a short period music. Using 'Load handel' to load the music. Use function 'sound' to play the music before and after filtered. Hear the difference. Plot the signal in frequency domain before and after passing through filter. Change the order to 50 and re-design the filter. Observe the change of magnitude response. See how many coefficients you get now.Explanation / Answer
clc;
clear all;
N=input('Enter order of the reqd BP filter ');
tau=(N-1)/2;
n1=0:N-1;
wc1=pi/4;
wc2=2*pi/3;
syms w n;
h=exp(1i*w*(n-tau));
h=load('test.wav');
hd=(1/(2*pi))*(int(h,w,-wc2,-wc1)+int(h,w,wc1,wc2));
for i=1:N
if i-1==tau
hdn(i)=(wc2-wc1)/pi;
else
hdn(i)=subs(hd,n,i-1);
end
end
hdn=real(hdn);
% All Window
for i=1:N
hamm_win(i) = 0.54 - 0.46*cos(2*pi*(i-1)/(N-1));
hann_win(i) = 0.5*(1 - cos(2*pi*(i-1)/(N-1)));
rect_win(i) = 1;
blac_win(i) = 0.42 - 0.5*cos(2*pi*(i-1)/(N-1)) + 0.08*cos(4*pi*(i-1)/(N-1));
end
hamm_hpf=hdn.*hamm_win;
hann_hpf=hdn.*hann_win;
rect_hpf=hdn.*rect_win;
blac_hpf=hdn.*blac_win;
figure;
subplot(4,3,1);
plot(hamm_hpf);
title('');
subplot(4,3,2);
plot(fir1(N-1,[wc1/pi wc2/pi],hamming(N)));
title('Blackman Window - Computed BandPass FIR Filter, MATLAB Inbuilt FIR Filter & Magnitude Response ');
hamm_hpfmag=sum(hamm_hpf.*exp(-1i*w*n1));
subplot(4,3,3);
ezplot(abs(hamm_hpfmag),[-pi pi]);
title('');
subplot(4,3,4);
plot(hann_hpf);
title('');
subplot(4,3,5);
plot(fir1(N-1,[wc1/pi wc2/pi],hann(N)));
title('Blackman Window - Computed BandPass FIR Filter, MATLAB Inbuilt FIR Filter & Magnitude Response ');
hann_hpfmag=sum(hann_hpf.*exp(-1i*w*n1));
subplot(4,3,6);
ezplot(abs(hann_hpfmag),[-pi pi]);
title('');
subplot(4,3,7);
plot(rect_hpf);
title('');
subplot(4,3,8);
plot(fir1(N-1,[wc1/pi wc2/pi],rectwin(N)));
title('Rectangular Window - Computed BandPass FIR Filter, MATLAB Inbuilt FIR Filter & Magnitude Response ');
rect_hpfmag=sum(rect_hpf.*exp(-1i*w*n1));
subplot(4,3,9);
ezplot(abs(rect_hpfmag),[-pi pi]);
title('');
subplot(4,3,10);
plot(blac_hpf);
title('');
subplot(4,3,11);
plot(fir1(N-1,[wc1/pi wc2/pi],blackman(N)));
title('Blackman Window - Computed BandPass FIR Filter, MATLAB Inbuilt FIR Filter & Magnitude Response ');
blac_hpfmag=sum(blac_hpf.*exp(-1i*w*n1));
subplot(4,3,12);
ezplot(abs(blac_hpfmag),[-pi pi]);
title('');
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.