Tympan / Tympan_Library

Arduino/Teensy Library for Tympan Open Source Hearing Aid
MIT License
122 stars 32 forks source link

Apparent Fs mismatch in IIR_wAFC full system example #26

Open produceconsumerobot opened 3 years ago

produceconsumerobot commented 3 years ago

The sampling frequency in the IIR_wAFC in the main ino seems to mismatch the "assumed" rate in filter_coeff_sos.h I'm not totally clear what the consequences of that would be, but I could imagine the crossover freqs being off by ~10% or something more kooky.

24000 in https://github.com/Tympan/Tympan_Library/blob/master/examples/05-FullSystems/WDRC_3BandIIR_wAFC/filter_coeff_sos.h#L31 vs 22050 in https://github.com/Tympan/Tympan_Library/blob/master/examples/05-FullSystems/WDRC_3BandIIR_wAFC/WDRC_3BandIIR_wAFC.ino#L48

Similar issue in 8 band IIR wAFC

chipaudette commented 3 years ago

Now that we have an IIR filter block that can calculate it's own coefficients, we need to update these two sketches to simply compute the coefficients for themselves. Then, we avoid the mismatched sample rate.