ELEC 320, Fall 2006
Profs. Wismer & Kozick
Simple Digital Filtering with Matlab
No report is required for this lab, but please demonstrate your
filters and discuss your results with the instructor.
- Please finish
Lab 1, if you haven't already.
- Complete item 6 on the Lab 1
assignment, which asks you to measure the "step response"
of your filters. The objective is to observe the filter output
when the input is the step function u(t).
This will give us a view of the filter operation in the "time
domain," as opposed to our previous "frequency domain" viewpoint.
You can achieve a unit step input using a square wave from the
(Think of this as applying step functions periodically in time.)
You can omit the op amp from your filters, and use only the
RC or RLC portions.
Try to relate the "duration" of the step response of
each filter to the associated "cutoff frequency" in the
Include a brief
discussion in your lab report.
- Please download the Matlab program
which reads in a file with digitized music.
You will also need to download the file
slove.au and save it in the same directory
You will have an opportunity to apply various digital filters
to the music and listen to the results.
If x[n] represents the digital music signal and y[n]
is the output from the digital filter, implement the following
filters in MATLAB and apply them to the music:
- y[n] = (x[n] + x[n-1] + ... + x[n-(N-1)]) / N
(Output at time n = mean of previous N inputs; try various values for N.)
- y[n] = a * y[n-1] + x[n], where 0 < a < 1. (Try various values for a.)
- y[n] = x[n] - x[n-1]. (This is like a derivative operation.)
Can you identify each filter as low-pass or high-pass?
Does this agree with your understanding of the associated
Digital filters are widely used in modern systems.
Digital filters are nothing more than discrete-time systems
that are described by difference equations.
Digital filters are often executed on DSP chips that are
specially designed to execute multiply-and-add operations
- Original music:
- Result of filter 1 with N = 5:
- Result of filter 2 with a = 0.9:
- Result of filter 3:
You can listen to each file from a web browser,
or you can
download each file into your filespace and read it into Matlab
with the commands:
y1 = auread('out1.au');