Question

1. Design a bandpass filter to meet the following specificatoins: lower stopband edge = 0.3π upper...

1. Design a bandpass filter to meet the following specificatoins:

lower stopband edge = 0.3π

upper stopband edge = 0.6π

lower passband edge = 0.4π

upper passband edge = 0.5π

Rp = 0.5 dB, As = 50 dB

Use a sampling frequency of 1000 Hz.

You may use MATLAB and the fir1 commmand to implement. It is advisable to check the MathWorks site for help on using these commands. It is advisable to check if the commands use the ripple in dB or in absolute units and you may use MATLAB commands to convert if needed. Note, since you must title and label axes, the default plot from freqz is not sufficient but you may use freqz to generate the frequency response and plot that data using the plot command ( and a few others to convert to dB ).


a. Use one of the fixed windows that meets specification. Plot the magnitude ( in dB ) and phase response. Note: the order of the filter can be computed according to the formulas on page 20 of file ADSP-10 and the example on page 23, for example for the Hamming window :

4w = 6.6π/L

where L = filter order and 4w is the transition band width. ( 1 point )

b. Use a Kaiser window to meet the same specification. Plot the magnitude ( in dB ) and phase response. You may use MATLAB commands to estimate the order of the filter and implement using the fir1 command. ( 1 point )

c. Verify that both part a. and part b. meet the Rp and As specifications. ( 1 point )

Please use matlab

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB script:

clc;close all;clear all;

%LPF

fs=[0.3*pi 0.6*pi];

Rp=0.5;As=50;

fp=[0.4*pi 0.5*pi];Fs=1000;

fc=(fp+fs)./(2*pi);

%Transition width

TW=min(fp(1)-fs(1),fs(2)-fp(2));

% FIR LPF using Hamming window

M=(6.6*pi/TW);

hd=fir1(M,fc,'bandpass',hamming(M+1));

%Frequency response

w=0:pi/2000:pi;

H=freqz(hd,1,w);

figure;

subplot(211)

plot(w/pi,20*log10(abs(H)),'r');grid;

xlabel('w Xpi');ylabel('|H(exp(jw)| in db');

title(' BPF using Hamming window-Magnitude ')

subplot(212)

plot(w/pi,angle(H),'b');grid;

xlabel('w Xpi');ylabel('<H(exp(jw)>');

title('Phase response')

% kaiser window

f =[fs(1) fp(1) fp(2) fs(2)]./pi;

Rp=(10^(Rp/20))-1;

Rs=10^(-As/20);

[M,Wc,Beta,ftype] = kaiserord(f,[0 1 0],[Rs Rp Rs]);

M = M+ rem(M,2);

wk = fir1(M,fc,ftype,kaiser(M+1,Beta),'noscale');

%Frequency response

H=freqz(wk,1,w);

figure;

subplot(211)

plot(w/pi,20*log10(abs(H)),'r');grid;

xlabel('w Xpi');ylabel('|H(exp(jw)| in db');

title('BPF using kaiser window-Magnitude ')

subplot(212)

plot(w/pi,angle(H),'b');grid;

xlabel('w Xpi');ylabel('<H(exp(jw)> in db');

title('Phase response')

c) Kaiser window meets the specifications exactly when compared with the hamming window.

Add a comment
Know the answer?
Add Answer to:
1. Design a bandpass filter to meet the following specificatoins: lower stopband edge = 0.3π upper...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT