[sdiy] FIR or IIR Digital filters for the PIC
Scott Gravenhorst
music.maker at gte.net
Thu Jun 5 17:15:50 CEST 2008
Csaba Zvekan <czvekan at gmail.com> wrote:
>Hi group,
>
>Has anybody done some work on FIR and IIR digital filters with the PIC
>or dsPIC family that can be used for SDIY ?
>I would look at some codes and designs .
Not for a PIC, but for DSP inside an FPGA.
I tried to use a single stage IIR filter as the main filter in the GateMan-I synth.
While it works, it is sonically underwhelming. It is, however, very easy to tune.
This filter does not have what we call a corner frequency, at least not in the same
way we describe analog filters like SVF or ladder. It also doesn't have resonance.
The single stage IIR leaves the corner frequency at zero Hz and the tuning parameter
changes the rolloff slope. Sonically, it's more like a simple tone control than what
we like to use as an audio filter in music.
Two places I found this IIR filter very useful and appropriate are the reflection
filter in PolyDaWG/8, a Karplus-Strong tight string synth and as the main processing
element to implement portamento in all 3 of the GateMan synths.
The reason I mention a single stage IIR is that it's simplicity will be attractive to
someone using a device like a PIC, but I warn that it is not a good choice for a
filter used as we often do in modular type synths.
An FIR can be quite simple too, but is not so easily tuned, fixed filters are fairly
easy to implement.
AVRsynth (google it) is probably a good place to look at digital filter code for
microprocessors, I don't know what type of filter is used in that synth however.
My favorite digital filter so far is the State Variable Filter. While it sounds
great (IMO), it does have some rather intense computational and sample rate
requirements. I found it fairly simple to implement and it tunes quite easily.
I'd give references to my Verilog code, but it isn't that easy to transmute into
microprocessor type instructions.
If you are interesed, here are links to the projects I've published:
- http://www.fpga.synth.net/pmwiki/pmwiki.php?n=FPGASynth.GateManI
- http://www.fpga.synth.net/pmwiki/pmwiki.php?n=FPGASynth.GateManII
- http://www.fpga.synth.net/pmwiki/pmwiki.php?n=FPGASynth.DigitalWaveguide
- http://www.fpga.synth.net/pmwiki/pmwiki.php?n=FPGASynth.GateManPoly
These projects are all implemented on a Xilinx Spartan-3E Starter Kit (a development
board) with very minimal external hardware (the schematics for the external hardware
are posted with the projects and is the same hardware for all of them).
-- ScottG
-----------------------------------------------------------------
-- Scott Gravenhorst
-- GateManPoly - FPGA Based Polyphonic MIDI LA/FM Synthesizer
-- GateMan-III - FPGA Based Monophonic MIDI LA/FM Synthesizer
-- PolyDaWG/8 - FPGA Based 8 Voice Polyphonic MIDI Synthesizer
-- FatMan: home1.gte.net/res0658s/fatman/
-- NonFatMan: home1.gte.net/res0658s/electronics/
-- When the going gets tough, the tough use the command line.
More information about the Synth-diy
mailing list