Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove interpolation of IIR filter coefficients #1345

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

derselbst
Copy link
Member

During implementation of #1342, I found the IIR filter producing strange cracks and clicks. I haven't done a deep investigation but it seems that this was caused by big and frequent changes of the cutoff frequency by fres_mod.

I found that the clicks were produced by the code that interpolates the filter coefficients. I.e. setting if(dsp_filter_coeff_incr_count > 0) to if(FALSE) didn't cause any more clicks.

Without a deeper investigation of the numeric logic I don't know how to fix this. Yet, I don't think this justifies the more complex logic, and therefore I'm suggesting to remove that interpolation logic.

Attached is a ZIP with two audio samples. DF2.ogg (Direct Form 2) is the filter as implemented before this PR. DF2-nointerp.ogg is the same filter without any interpolation.

filter-coeff-interp.zip

@derselbst derselbst added this to the 2.4 milestone Jun 29, 2024
Copy link

sonarcloud bot commented Jun 29, 2024

@klerg
Copy link

klerg commented Jun 29, 2024

Very good to see you are already trying to put this into Fluidsynth. I'm not sure what IIR means or what that does to the filter. And I know even less on what fres_mod changes to the cutoff frequency but I'm sure you got this down to a tee.

As you can tell, at this point I'm pretty much lost on what all this means but glad you were able to find the issue and stop anymore clicks and pops to the sound as well.

Wow this seems like it will not be easy to find what is behind the problem at all then. Sure, on stuff like this it will be your call to do what you assume is the best way forward. So you had to remove it.

I just listened to both samples and find it hard to hear that much of difference, in other words, to me each sample has clicks and pops, but the second has barely any less, why is that ?

@derselbst
Copy link
Member Author

You need to listen till the end. The first clicks appear in DF2.ogg after 22 sec.

@klerg
Copy link

klerg commented Jun 30, 2024

Yes I'm able to hear the clicks in DF2.ogg but also get clicks in DF2-nointerp.ogg as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants