Biquad implementation in DaisySP

Hello !

I’m starting an embeded project with the Daisy Seed, and so, it make me look at the DaisySP library. I have two main questions about the biquad class :

  • As far as I have seen, it is not possible to provide the class with the coefficient directly. It is only possible to provide a frequency and a resonance. This seems very limiting, because, AFAIK, we can’t change the filter type, nor using the biquad class for more “exotic” type of filter. Wouldn’t it better to have a more generic class, where we can simply provide the 5 biquad coefficient, and have a helper function that generate the coefficients, depending on a cut off frequency, a Q factor and a filter type ?

  • The process function seems to implement the Direct Form I, directly adapted from the difference equation. If I remember correclty, it is not the common to have this form implemented, as it is use more memory and is prone to computation error. Wouldn’t it be better to have the Direct Form II Transposed implemented, with maybe a fall back to a non transposed form for architecture that don’t use floating point numbers ?

I would be more than happy to have some insight about this choice of implementation !
Thank you !
Jean-Loup

Hi,

I have used the CMSIS-DSP functions for this kind of thing - see Arm_biquad_cascade_df1_f32 and check out the hilbert_pdn and iir_bp_fb code here.

I used Direct Form I, but there are others available.

As for the motivation for how it’s done in DaisySP, I’m afraid I have no insight.

Cheers

Hi jaradical,
Thanks for your answer ! I will check this library, but I also seen an opportunity to contribute to the DaisySP library, if it makes sense anyway :wink:
Funnily enough, I also want to achieve a pitch modulation effect using an “hilbert” transform. I’ll check your parametric chorus !

Cheers !
Jean-Loup

1 Like