I use biquads in JSyn. The coefficients are calculated using RBJ's
excellent biquad cookbook from the music-dsp archives.

I have found that I can recalculate and update the filter coefficients on
the fly without unpleasant artifacts. I do NOT zero out or modify the
internal state variables. I should think that setting them to zero would
sound pretty bad.

Generally the filter settings are changed gradually using a knob or driven
by an LFO or envelope.

Phil Burk


On Tue, Mar 1, 2016 at 6:56 AM, Paul Stoffregen <p...@pjrc.com> wrote:

> Does anyone have any suggestions or publications or references to best
> practices for what to do with the state variables of a biquad filter when
> changing the coefficients?
>
> For a bit of background, I implement a Biquad Direct Form 1 filter in this
> audio library.  It works well.
>
> https://github.com/PaulStoffregen/Audio/blob/master/filter_biquad.cpp#L94
>
> There's a function which allows the user to change the 5 coefficients.
> Lines 94 & 95 set the 4 filter state variables (which are 16 bits, packed
> into two 32 bit integers) to zero.  I did this clear-to-zero out of an
> abundance of caution, for concern (maybe paranoia) that a stable filter
> might do something unexpected or unstable if the 4 state variables are
> initialized with non-zero values.
>
> The problem is people wish to change the coefficients in real time with as
> little audible artifact as possible between the old and new filter
> response.  Clearing the state to zero usually results in a very noticeable
> click or pop sound.
>
> https://github.com/PaulStoffregen/Audio/issues/171
>
> Am I just being overly paranoid by setting all 4 state variables to zero?
> If "bad things" could happen, are there any guidelines about how to manage
> the filter state safely, but with with as graceful a transition as possible?
>
>
>
> _______________________________________________
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp
>
>
_______________________________________________
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Reply via email to