Lab 2: Dataflow - Build an FIR filter
- Due 3 May 2022 by 15:00
- Points 1
In this assignment, you are supposed to construct a small finite impulse response (FIR) filter. Start by reading about them here
Links to an external site..
In the picture, you see three different components:
- z-1 corresponds to Ptolemy's
SampleDelay
actor (Actors/FlowControl/SequenceControl, - the triangles are multipliers that multiply their input by a constant factor (you will have to simulate this using Ptolemy's
Const
(Actors/Sources/GenericSources) andMultiplyDivide
(Actors/Math), and - the Sum-Signs represent
AddSubtract
(Actors/Math).
Your FIR filter will be of order 5, which means it has 6 coefficients ("taps"), which are in this order -0.2, 0.3, 0.4, 0.4, 0.3, -0.2. Construct it using only SampleDelay
, Const
, MultiplyDivide
, and AddSubtract
.
Download this model skeleton. Download Download this model skeleton.
The top level model is a small test harness that generates a sinusoid signal, adds a bit of noise to it, and feeds the result into a composite actor --- that's the one you are supposed to create your FIR filter in --- and a reference FIR filter from the Ptolemy library. Two plotters allow you to look at the results. The plotter at the bottom acts as a check whether your implementation is correct: it shows the difference between the output from your FIR filter and Ptolemy's implementation. If your version is correct, it should display a flat line.