Hi! I've inherited a program that works with a BF561 but I am trying to switch from using a FIR filter to the library functions for IIR filters and I have a few questions:

1) There are so many settings in Matlab to export coefficients, I'm trying to make sure I get them right. If I'm using the library function iir_fr32(), what settings do I need to consider when I export? Export as SOS, I believe. 32 bits? Or is it 31? What about overflow? and Matlab keeps outputting scaling values. How do I use those or negate those in my filter settings?

2) If I'm reading the program I inherited correctly, it looks like the current filter I'm using filters one sample at a time. Would it work with the iir_fr32() function to send one sample through at a time? Or does it need to be a whole waveform? Or can it be just part of a waveform at a time?

I'm pretty new at using filters so any details you can help with would be appreciated.

Thanks!

Cristi

Hi, I just wanted to give an update for anyone else that might be struggling with this...

1) I needed a elliptic IIR filter for this application. The library function iir_fr32() needs a and b coefficients (NOT a and b coefficients from second order sections). Matlab tells me that elliptic IIR filters are inherently unstable with a and b coefficients and will not let me create a filter with those outputs. Besides that, the library function iir_fr32() was trying to use up too much of my L1 memory to make it feasible. I ended up needing to write my own biquad function and exporting SOS coefficients from Matlab.

2) Coefficients as second order sections can be output in multiple different ways and you can scale them however you need to in order to make them fit your function without overflow. Go figure.

3) Yes, I've been able to filter a single sample at a time. IIR filters use delay lines that get saved in between each sample to create the feedback for each loop. But again, I wasn't able to use the library function iir_fr32() with my application. I have read that other people had success with the library functions even with only one sample at a time.

Cristi