

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Instructions for a project comparing the characteristics of seven different low pass filters in the context of signals and systems. The filters include a running average filter, truncated sinc filters with various window functions, fir filters generated by matlab functions fir1 and fir2, and an iir filter generated by the matlab function ellip. Students are required to evaluate the filters based on simulation results, with specifications including sampling frequency, cutoff frequencies, filter orders, and impulse response functions.
Typology: Exams
1 / 2
This page cannot be seen from the preview
Don't miss anything!
CMPE2322 Signals and Systems Page 1 of 2
Exam 2 Project Due Tuesday April 7th in class (no late submission) Spring 2009
In this project you are going to do a comparative design of a low pass filter. The low pass
filter will filter out or attenuate signals with frequencies higher than your designated
cutoff frequency. In the design effort you will compare a total of seven filters. The filters
are a running average low pass filter, three truncated sinc filters with different window
functions, the FIR filters generated by the matlab functions fir1 and fir2, and a IIR filter
generated by the matlab function ellip. You will be asked to evaluate certain
characteristics of the filter based on your simulation results.
The sampling frequency of the system is 40 kHz. The cutoff frequencies for your low
pass filters are as specified. The order M of all your FIR filters is assigned and will be the
same except for the running average filter. The IIR filter order is also assigned but
remember that the order of the IIR filter is the order N of the feedback coefficients.
The Mth order running average filter impulse response function h[n] has M+1 ones and is
expressed as:
1
1
M
h n
The frequency response
exp
( 1 )sin
sin
exp j M
H j
is linear in angle
and has magnitude
( 1 )sin
sin
given by the Dirichlet function (diric in matlab)
which is equal to the sinc
sin
at small ^ where
sin M M but is larger as ^ approaches the maximum possible
^ without aliasing. For ^ less than the numerator determines the zero crossings of
the magnitude function and they are the same as the sinc function. The magnitude
function is equal to 1 at ^ = 0 and decreases to the 2 at the normalized cutoff just
before the first zero crossing
1
2
ˆ
M
. This indicates for the running average FIR filter
being used as a low pass filter M itself determines the desired cutoff frequency and the
highest cutoff frequency possible is ^= or 1/2 the sampling frequency. Assuming the
cutoff frequency is approximately one half the zero point crossing
1
2
2
1
ˆ
M
c
can be
used to find M for your required c
. M should be rounded up to the largest integer to
make sure the cutoff frequency is lower than your specified cutoff frequency. For your
order M find hn the impulse response. For FIR filters the hn are also the bk values and for
the running average filter is a vector with M+1 values of 1/(M+1) Do a frequency plot
freqz(b,1,wh) where wh = -pi:pi/300:pi; defines ^ from -pi to +pi. If M is odd such that
M+1 is even to get a good graph on the graph click Edit, Axis Properties. In the Axis
Properties Editor pop up select Y axis and change the limit number on the left to -10dB
CMPE2322 Signals and Systems Page 2 of 2
Exam 2 Project Spring 2009
or -3dB if you want to see exactly where the cutoff frequency is. Also do a magnitude
plot by first entering Hn = freqz(hn,1,wn) and then plot(wn,abs(Hn)); to plot on a linear
scale. Change the y axis min to 0.707 to again see were the cutoff frequency of the filter
is.
The sinc filter is for a cutoff frequency w^ = 0.4 = omegac is defined and plotted by the
matlab statements:
omegac = 0.4;
M = yourvalue;
m = (N-1)/2;
n = 0:2*m+10;
h = omegac/pisinc(omegac(n-m)/pi);
w = [ones(1,N) zeros(1,length(n)-N)];
hd = h.*w;
omega = -pi;2*pi/300:pi;
Hd = freqz(hd,1 omega);
plot(omega,abs(Hd));
You could just do freqz(hd,1,omega) which will plot the magnitude in dB and angle.
For the effect of windows change the w line as follows
For the hanning window: w = 0.5(1-cos(2pi*n/(N-1))); and for the hamming window
w = 0.54-0.46cos(2pi*n/(N-1));
Also do FIR filtres for your assigned M and fc using fir1 and fir2.
Lastly use ellip to do your assigned N order IIR low pass filter with the same fc.
It is possible to generate a single graph of magnitude of output with all filters if each Hn
frequency response is generated for the same wn. That is Hn1 = freqz(hn1,1,wn) Hn2 =
freqz(hn2,1,wn) etc except the last IIR filter that will be Hn7 = freqz(hn7,a7,wn). Then to
plot them all do plot(wn,Hn1,wn,Hn2,wn,Hn3,wn,Hn4,wn,Hn5,wn,Hn6,wn,Hn7) which
should create a graph of the 7 sets of frequency response. Include printout of all your
graphs including two single graphs one dB and one magnitude with all filters and also
copies of all code in your exam solution. Label and identify all graphs and code.
From the graph data answer the following questions on a typed page. Which filter has the
sharpest decrease in magnitude between 0.9 times your fc and 1.1 times your fc (translate
to ^ values)? Which filter has the most accurate fc (-3dB point of each filter)? Which
filter maintains the highest average magnitude closest to 1 from 0 to 0.9 times your fc?
Which filter has the lowest magnitude from 1.1 times your fc to w^ = pi?
Elizondo Garcia Guerrero Rodriguez Villarreal
fc Hz 3000 3500 4000 4500 5000
M for FIR 20 18 16 14 12
N for IIR 4 6 8 10 12