MATLAB Project ECE512F: ECE512 University of Toronto
MATLAB Project ECE512F: ECE512 University of Toronto
University of Toronto
MATLAB Project
ECE512F
Objective:
To introduce the basics of filter design using MATLAB as a CAD tool.
Using MATLAB, plot the magnitude and phase responses for the following
continuous-time lowpass filters.
a) A 4th order Butterworth filter with 3dB frequency at 1 rad/s from 0 to 10 rad/s
b) The same as a) but with the 3dB freq at 10 kHz and plot from 0 to 100kHz
c) Compare the filter coefficients for the 2 filters when in polynomial form.
E2)
Plot the magnitude responses for the following continuous-time lowpass filters.
a) A 4th order Cheby1 filter with a 1dB passband ripple up to 1 rad/s from 0 to 10
rad/s.
b) The same as c) but a Cheby2 filter
c) Compare the two magnitude responses for ripple locations
E3)
Plot the magnitude response for the following continuous-time lowpass filters on the
same plot.
a) A 4th order Elliptic filter with 1dB passband ripple up to 1 rad/s and 30dB
stopband attenuation from 0 to 10 rad/s.
b) A 4th order Bessel filter from 0 to 10 rad/s.
E4)
Write a MATLAB m-file that will plot the magnitude response for a second-order
lowpass filter given o , Q, and dc gain. Plot the gain in dB from 0 to 10 o . Check
your code with various pole-frequencies, Q and dc gains.
E5)
Write similar m-files as E4) for highpass, bandpass and notch second-order filters (you
will need to modify the inputs).
E6)
Find the poles and zeros for a 4th order Elliptic filter with 1 dB passband ripple up to
1 rad/s and 30dB stopband attenation (this is the same as in E1)). Separate this filter
into 2 biquad filters and plot the magnitude responses for each. Combine the two plots
together to check that they result in the Elliptic filter once more.
1 of 2
ECE512
University of Toronto
E7)
Using the bilinear transform, find an H(z) to realize a Chebyshev discrete-time filter
with a peak gain of one, a passband frequency from 0 to 1kHz, and a stopband
frequency of 1.5kHz when the sampling rate is 10kHz. The passband ripple and
stopband attenuation should be 0.5dB and 20dB, respectively.
E8)
Use simulink to verify your design in E7) by applying white noise and plotting the
power spectral density.
E9)
Put the second order modulator shown below into simulink.. Use a one bit quantizer
u(n)
y(n)
Quantizer
that has +1 and -1 as its output and let all the sampling times be 1 second. Apply a
sinusoidal input that is at 2 128 rad/sample and then filter the output with a 3rd
order butterworth filter that has a passband edge at 2 64 . Look at the time domain
and frequency domain representations of the 1-bit and lowpass filtered signals.
E10)
Change the quantizer in E9) so that it uses 16 levels of quantization and re-investigate
the signals.
2 of 2