Single Stage II Rfilter
Author: Scott Gravenhorst
For Spartan-3E SK
Here are two Verilog projects that use the single stage recursive IIR filter module. NCO_NCF_Sweep is a triangle LFO modulating the NCF with an NCO fixed at one of two switch selectable frequencies. NCO_NCF_Twiddle replaces the LFO with the rotary encoder to allow twiddling the frequency setting of the filter, again with a dual frequency NCO. Switches work as follows:
off: filter input waveform to DAC on: filter output waveform to DAC
off: square wave on: sawtooth wave
off: NCO freq x 1 on: NCO freq x 4
off: slow twiddle (only for NCO_NCF_Twiddle) on: fast twiddle (only for NCO_NCF_Twiddle)
NCO_NCF_Sweep: controls NCO frequency (switch 2 still does x 4)
NCO_NCF_Twiddle: controls NCF frequency - for you twiddlers out there...
This filter was chosen because of it's ease of implementation and that it's frequency control elements can be calculated on the fly with a simple subtraction. This makes it possible to numerically control without the use of any tables. The frequency control is somewhat linearized by use of a cubic converter, the frequency control number is cubed with it and then applied to the filter's frequency input.
Note that the filter module does not contain any storage elements, thus the filter math module is combinatorial, so it may be multiplexed for a multivoice polyphonic system. These are supplied by the instantiating module. For polyphony, each voice must maintain it's own storage elements for it's timeslice of the filter.
The mp3 file contains a filter sweep, constant freq NCO, sweep LFO is triangle. First, about 2 LFO cycles of square wave NCO then about 2 LFO cycles of sawtooth NCO.
The projects are each in their own zip files: NCO_NCF_Sweep.zip and NCO_NCF_Twiddle.zip
There are no oscope images because I don't have a good way to capture them. I'll leave the display of the waveforms to those of you who download and try the projects.
Output comes from DAC output A on the Start Kit board.