IIR Filter Coefficient calculating

General discussion on mikroPascal for dsPIC30/33 and PIC24.
Post Reply
Author
Message
peter1308
Posts: 5
Joined: 18 Nov 2008 13:47

IIR Filter Coefficient calculating

#1 Post by peter1308 » 18 Nov 2008 22:51

Hi evereyone,

i'm new in programming dsPIC and like to build an programmable bandpassfilter. The Filter Tool is a nice toy, but allows only the calculation for the source code. So the result is not changeable.
The coefficients for the filter should calculated on an other processor witch submit these parameter to the host. The calculation for FIR filter is clear, also the transformation to fractal format. For IIR filters i could calculate the model parameters in floating point format and it's claer that they must be between -1 and 1 for the fractal format. That' s the use of scale_a and scale_b factors, i guess. But how are they calculated? There ar serveral possibilities to calculate scaling factors but no model i found matched to the factors generated by the filter tool.
Because the generated source code from filter tool always declares the parameters as const my second question is: Is it in general possible to declare them as variables? The compiler don't generate an error, but will the DSP work?
Could someone help me?

PS.: May be a moderator see this posting and recognize that i have made this posting first in the mikro Pascal general forum please delete it there. Or tell me how i could do it by myself.

peter1308
Posts: 5
Joined: 18 Nov 2008 13:47

#2 Post by peter1308 » 20 Nov 2008 16:32

Ok solved. For all how are interested : Scale meens coeff*2^scale as factor for all coefficients (A or B) if one is not in -1->1 or all factors are very small.

FRM
Posts: 381
Joined: 20 May 2005 18:58
Location: UK

#3 Post by FRM » 21 Nov 2008 11:09

This could be useful info - thanks for keeping the community updated on your findings Peter.

If you are logged in to the forum then when viewing your own posts you should have an 'X' button next to the edit button to the R/H side of your post - click that to delete it.

paxton
Posts: 1
Joined: 19 Jan 2011 21:17

Re: IIR Filter Coefficient calculating

#4 Post by paxton » 19 Jan 2011 21:24

hi,

can someone explain to me how to calculate this?

I didn't understand what peter meant on his 2nd post.

Post Reply

Return to “mikroPascal for dsPIC30/33 and PIC24 General”