Reverse freq/gain/qfactor from biquad coefficients

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
For a DSP board I am working on a way to not only upload settings, but also download them from the board.

I could in theory send extra data along, but since the board already gets the a0/a1/a2/b0/b1/b2 coefficients, it would be nice to reverse engineer the filter type, frequency and qfactor from that.

For the conversion from filter specs to coefficients I use the RBJ cookbook formulas. Is there some way to reverse these formulas or would that be mathematically impossible?
 
This is pretty straightforward but tedious. All of the filter types:
gain stage
first order HP
first order LP
first order AP
first order shelving filter
second order HP
second order LP
second order AP
second order shelving filter
biquadratic filter
notch filter

have closed forms, times an overall gain factor (possibly just unity gain). First you look at the order of the denominator. This will tell you the order of the filter. Next, you look at which numerator coefficients are zero. This will tell you if it is a HP, LP, etc. Then you look for the s and constant terms to get e.g. Q and Wo. It's a lot of bookkeeping, but it is possible to do it.

If you are not familiar with transfer functions, start there. Keep in mind that there are analog form (e.g. in s) TFs and digital form (z^-1) TFs and you will be working with coefficients from the latter.

Honestly if this is just for your own project, it would be much simpler just to upload the values instead of writing code to extract them from the transfer functions. If you have to work with transfer functions above second order you must first factor the higher order numerator and denominator polynomials into first and second order filter forms and then extract the parameters. Good luck coding that!
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.