In: Electrical Engineering
Design a LP FIR filter to meet the following specifications using the window method. Use a Blackman window.
Fs = 25 kHz
Fc = 5.0 kHz (3 dB down)
Attenuation = 80 dB at 7 kHz
Give all the relevant plots (impulse, frequency responses) and the performance of the final filter. Compare this filter to one designed using the optimal method.
(Please use MATLAB to give all the answers)
m=80; % The length of the Karnel%
n=0:1:m-1; %Defines Range of position value%
p=n-(m-1)/2; %Angle%
fc=5; %Define Cutoff frequency%
Z=sin(2*pi*fc*p)./(pi*p); %Define truncated Sinc function%
stem(n,Z);grid %To represent the discrete signal value & draw the grid lines%
title('Unit Sample Response of the sin function') %Define the title of the figure%
xlabel('n') %Define the label of on x axis%
ylabel('Z') %Define the label of on y axis%
figure; %To draw a figure%
[h,w]=freqz(Z); %get Frequency Response%
plot(w/pi,abs(h));grid
title('Frequency response of the sin function')
xlabel('Frequency')
ylabel('Amplitude')
figure;
s=2*pi*(n/(m-1)); %Angle%
w=0.54-0.46*cos(s); %Define blackman window function%
stem(n,w);grid
title('blackman Window')
xlabel('n')
ylabel('w')
figure;
t=Z.*w; %Multiplication of blackman Window and sin function%
stem(n,t);grid
title('Multiplication of blackman Window and sin function')
xlabel('n')
ylabel('t')
figure;
[h,w]=freqz(t);
plot(w/pi,abs(h));grid
xlabel('Frequency')
ylabel('Magnitude')
title('Frequency response of the windowed sin function')
figure;grid
freqz(t)
title('Frequency Response of the windowed sin function in dB')