 # The purpose of this filter exercise is to design an IIR Filter that...

## Question

The purpose of this filter exercise is to design an IIR Filter that meets/exceeds specifications.
The requirements of this design are as follows:
• Use the Matlab App or an equivalent program to design a filter with the specifications as below.
• Bring the coefficients of the filter into MATLAB.
• Calculate the transfer function H(z) and the Difference Equation for the filter.
• Using MATLAB, plot the frequency response for the filter between 0 and fs/2 for the filter. Include the ideal response in your graph. The graph must be properly annotated with title, axis, and legend.
• Use MATLAB to calculate and plot the Poles and Zeros of the filter.
• Generate an input signal, x(n) as the sum of three equal amplitude cosines at frequencies, fs/6, fs/4, and fs/3.
• Use the filter operator in MATLAB to illustrate the input and output of the filter.
• Hand in a package including the filter specifications, a discussion of what specifications are met and which are exceeded, all Matlab Scripts used, graphs, and a discussion of what you did, assumptions made, etc.
No credit will be if just equations, Matlab code, and figures are given.
Note: The filter app might create a series of cascaded second-order filters.
Convert the second-order filters to a single filter with response H(z).
Filter Choice To decide which filter you are to implement, divide your student number by 9 and take the remainder. Implement the filter chosen by the remainder. If your remainder is 0, you have a wild card and can implement one of the filters below of your own choice.
Specifications
fs = 8000 Hz
For remainders 1-4
wp = .15 fs Passband Frequency in Radians
ws = .25 fs Stopband Frequency in Radians
Rp = 3 Passband Ripple in dB
As = 40 Stopband Attenuation in dB
1. Butterworth LP
2. Chebyshev-I LP
3. Chebyshev-II LP
4. Elliptic LP
For filters 5-8
ws = .175 fs Stopband Frequency in Radians
wp = .3 fs Passband Frequency in Radians
Rp = 4 Passband Ripple in dB
As = 50 Stopband Attenuation in dB
5. Butterworth HP
6. Chebyshev-I HP
7. Chebyshev-II HP
8. Elliptic HP

## Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

clear;
close all;

t=0:0.00001:0.01;

Fs = 8000;
x= cos(2*pi*(1/6)*Fs*t) + cos(2*pi*(1/4)*Fs*t) + cos(2*pi*(1/3)*Fs*t);

% Set filter specifications
fp = 0.15;
fs = 0.25;
Ap = 3;
As = 40;

[N,Wn] = buttord(2*fp, 2*fs, Ap, As);

[zb,pb,kb] = butter(N,Wn);
[bb,ab] = zp2tf(zb,pb,kb);
[hb,wb] = freqs(bb,ab,4096);
%
[n,Wp] = cheb2ord(fp*1.2, fs*1.2, Ap, As)
[z1,p1,k1] = cheby1(n,Ap,Wp);
[b1,a1] = zp2tf(z1,p1,k1);
[h1,w1] = freqs(b1,a1,4096);
%
[n,Ws] = cheb2ord(2*fp, 2*fs, Ap, As)
[z2,p2,k2] = cheby2...

By purchasing this solution you'll be able to access the following files:
Solution.pdf and IIR.m.

# 50% discount

Hours
Minutes
Seconds
\$28.00 \$14.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

View available Signal Processing Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.