Question

MATLAB

Filter Design using the Parks-McClellan Algorithm Using the Parks-McClellan (PMC) algorithm, design filters with the followin

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

Bleow is the matlab code. The filter order is given in image title.

close all,
clear all,
clc,

Fs = 2*pi; % Sampling frequency

rp = 1; % Passband ripple
rs = 40; % Stopband ripple
f = [0.1*pi 0.3*pi]; % Cutoff frequencies
a = [1 0]; % Desired amplitudes Low Pass Filter

figure,
dev = [(10^(rp/20)-1)/(10^(rp/20)+1) 10^(-rs/20)];
[n,fo,ao,w] = firpmord(f,a,dev,Fs);
b = firpm(n,fo,ao,w);
freqz(b,1,1024,Fs);
str=strcat('Lowpass Filter Designed to Specifications at Order = ',num2str(n)); title(str);


rp = 1; % Passband ripple
rs = 40; % Stopband ripple
f = [0.7*pi 0.9*pi]; % Cutoff frequencies
a = [0 1]; % Desired amplitudes High pass Filter
figure,
dev = [(10^(rp/20)-1)/(10^(rp/20)+1) 10^(-rs/20)];
[n,fo,ao,w] = firpmord(f,a,dev,Fs);
b = firpm(n,fo,ao,w);
freqz(b,1,1024,Fs);
str=strcat('Highpass Filter Designed to Specifications at Order = ',num2str(n)); title(str);


rp = 1; % Passband ripple
rs = 40; % Stopband ripple
f = [0.1*pi 0.3*pi]; % Cutoff frequencies
a = [1 0]; % Desired amplitudes Low Pass Filter
figure,
dev = [(10^(rp/20)-1)/(10^(rp/20)+1) 10^(-rs/20)];
[n,Wn,beta,ftype] = kaiserord(f,a,dev,Fs);
hh = fir1(n,Wn,ftype,kaiser(n+1,beta),'noscale');
freqz(hh)
str=strcat('Lowpass Filter Designed using Kaiser Window to Specifications at Order = ',num2str(n)); title(str);

rp = 1; % Passband ripple
rs = 40; % Stopband ripple
f = [0.7*pi 0.9*pi]; % Cutoff frequencies
a = [0 1]; % Desired amplitudes High pass Filter
figure,
dev = [(10^(rp/20)-1)/(10^(rp/20)+1) 10^(-rs/20)];
[n,Wn,beta,ftype] = kaiserord(f,a,dev,Fs);
hh = fir1(n,Wn,ftype,kaiser(n+1,beta),'noscale');
freqz(hh)
str=strcat('Highpass Filter Designed using Kaiser Window to Specifications at Order = ',num2str(n)); title(str);



Highpass Filter Designed to Specifications at Order 14 60 25 30 1.5 0.5 Frequency (Hz) 300 200 100 2.5 15 0.5 200 Frequency (Lowpass Filter Designed to Specifications at Order 14 20 0 20 A0 60 80 25 100 15 05 Frequency (Hz) 100 200 300 2.5 1.5 05 400

Highpass Filter Designed using Kaiser Window to Specifications at Order 24 20 20 40 60 80 09 08 n 7 0.5 100 04 0.3 0.2 0.1 No

amalized Frequency (xTrad/samgle (gp) epnuubew (seeep 8seud

Add a comment
Know the answer?
Add Answer to:
MATLAB Filter Design using the Parks-McClellan Algorithm Using the Parks-McClellan (PMC) algorithm, design filters with the...
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