[sdiy] Re: IIR and FIR

Veronica Merryfield veronica.merryfield at shaw.ca
Fri Jun 6 06:43:39 CEST 2008


Here's a few links to get you going

www.gamedev.net/reference/articles/article845.asp
www.music.mcgill.ca/~gary/307/week2/filters.html
members.tripod.com/acmerock/tech/DXi2Tutorial.htm

But as I said, you really do have to pay a lot of attention to the  
numbers. Whilst the third of the links above has the term calculations  
for a variety of filter types, each term requires a trig function and  
some a divide. The simple formulas hide the effects of not only sample  
rate and quantisation errors of the samples, but it is compounded by  
quantisation of the terms and calculations. This is further affected  
by the trig functions and so on. I did the most work with fixed point  
16 bit DSP simulating diesel engines to test ECUs and it took a lot of  
fiddling to get the thing to work well but it did work extremely well.  
With floats, things are a lot easier and in many cases most people  
probably don't look into the numbers too deeply but for a PIC  
implementation. Unless a fast PIC and floats are used, a fair amount  
of care and time are going to be needed to make it work but I know it  
can work since a PIC is not too far away from a Z80.

(One can get very fed up with Z transforms and bilinears after a  
while, specially if the IIR keeps oscillating on you). Which reminds  
me, they can produce beautiful sines :)


On 5-Jun-08, at 5:09 PM, Magnus Danielson wrote:

> From: Scott Gravenhorst <music.maker at gte.net>
> Subject: [sdiy] Re: IIR and FIR
> Date: Thu, 05 Jun 2008 16:24:13 -0700
> Message-ID: <200806052324.m55NOD9l030103 at linux7.lan>
>
>>> Veronica Merryfield wrote:
>>> I have used IIR filters going back 20 years now even on a poor 6Mhz
>>> Z80 and they do resonate. FIRs don't resonate but IIRs do - it's why
>>> they are called Infinite Impulse Response . I can some code  
>>> somewhere
>>> in my archive for taking cutoff frequency and resonance and  
>>> producing
>>> the parameters which I can try to find if required but there are
>>> examples on the web.
>>
>> Are these sweepable filters?
>>
>> I'm interested in a frequency sweepable IIR with controllable  
>> resonance.  I.e., are they an acceptable alternative to an SVF?
>>
>> An SVF sounds very good to me, but does have high sample rate  
>> demands.
>
> Now, this is a bit problematic. Bilinear transformed filters (which  
> have good
> properties) tend to use arctan compensation. Doing that in realtime is
> expensive. However, for higher sample rates the filter cut-off stays  
> close to
> 0 and things can be approximated and behave fairly linear.
>
> If you map your integrators bilinearly you get for each integrator
>
> i1 = i0
> i0 = i1 + i*T
> o  = i0 + i1
>
> where i is the input, o the output and T is the sample time. i0 and  
> i1 is the
> integrator state variables.
>
> Converting a normal SVF into this form is trivial and only a slight  
> variation
> of what you already have around:
>
> http://www.fpga.synth.net/pmwiki/pmwiki.php?n=FPGASynth.SVF
>
> However, you can approximate the sin such that f = 2 pi Fc / Fs. I  
> think you
> are getting my point... the real trick is the sample rate and the  
> handy
> reductions it allows you to do.
>
> Cheers,
> Magnus
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy




More information about the Synth-diy mailing list