Design two lowpass FIR filters with M = 50 and omega_c = 0.6 pi, one using a Ham
ID: 2083599 • Letter: D
Question
Design two lowpass FIR filters with M = 50 and omega_c = 0.6 pi, one using a Hamming window, the other with a Rectangular window. Repeat the process with two FIR bandpass filters (M = 50) using cutoff frequencies at omega_c1 = 0.3 pi and omega_c2 = 0.6 pi. Discussion questions to consider: How close is the designed filter to an ideal filter? Is the Hamming-window design better? Why? How many zeros are found in the z-plane? Where are they located? How do the zero locations relate to the passbands and stopbands of the filters?Explanation / Answer
close all,
clear all,
clc,
CutOFF_Freq = 0.6;
Filter_Order = 50;
Filter_Type = 'low';
window = 'haming';
b = fir1(Filter_Order,CutOFF_Freq,Filter_Type,'haming','normalization','scale'); % DEfault Window - Haming
figure, freqz(b,1,512);
str = strcat('Low Pass Filter, Order = ',num2str(Filter_Order),' Window = ',window); title(str);
figure, zplane(b);
str = strcat('Z-Plane --> Low Pass Filter, Order = ',num2str(Filter_Order),' Window = ',window); title(str);
Filter_Type = 'low';
window = 'rectwin';
b2 = fir1(Filter_Order,CutOFF_Freq,Filter_Type,'rectwin','normalization','scale'); % DEfault Window - Haming
figure, freqz(b2,1,512);
str = strcat('Low Pass Filter, Order = ',num2str(Filter_Order),' Window = ',window); title(str);
figure, zplane(b);
str = strcat('Z-Plane --> Low Pass Filter, Order = ',num2str(Filter_Order),' Window = ',window); title(str);
Filter_Type = 'bandpass';
window = 'haming';
b = fir1(Filter_Order,[0.3 0.6],Filter_Type,'rectwin','normalization','scale'); % DEfault Window - Haming
figure, freqz(b,1,512);
str = strcat('Band Pass Filter, Order = ',num2str(Filter_Order),' Window = ',window); title(str);
figure, zplane(b);
str = strcat('Z-Plane --> Band Pass Filter, Order = ',num2str(Filter_Order),' Window = ',window); title(str);
Filter_Type = 'bandpass';
window = 'rectwin';
b = fir1(Filter_Order,[0.3 0.6],Filter_Type,'rectwin','normalization','scale'); % DEfault Window - Haming
figure, freqz(b,1,512);
str = strcat('Band Pass Filter, Order = ',num2str(Filter_Order),' Window = ',window); title(str);
figure, zplane(b);
str = strcat('Z-Plane --> Band Pass Filter, Order = ',num2str(Filter_Order),' Window = ',window); title(str);
Discussion:
Band-pass filter has maximum gain in pass band region.Therefore, lots of poles opposite the imaginary axis should be around the band pass frequency.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.