logicomacorp / WaveSabre

Official WaveSabre repository
MIT License
246 stars 34 forks source link

Remove biquad filter zero clamp #62

Closed armak closed 3 years ago

armak commented 3 years ago

The clamping of one of the delay samples causes a discontinuity in the filter feedback path that results in self oscillation even while the input is zero. The self oscillation is very quiet, somewhere around -70dB (possibly more at very low cutoffs and large Q values), but in practice can become easily audible if the signal path after the biquad contains further processing, especially saturation that boosts the signal. It's also especially noticeable with Leveller, as it contains five individual biquad stages. Removing the clamp doesn't have any other audible adverse side effects based on my testing. (Of course it also makes for a tiny improvement in both size and performance as well.)

yupferris commented 3 years ago

We discussed this privately, but just so we have it here: this could be considered a sound regression, but I think it's something we need to fix. I believe this is residual from the x87 days (before spring/summer 2018 or so) where we had to worry about denormals in just about every signal path that had any kind of feedback. With SSE and FTZ/DAZ, this is no longer an issue, and the audible artifacts have no place being there. So even though it will change the sound quality of some rather fundamental devices (eg. Leveller) I think it's the right move.

Side note: judging by the self-oscillation here, I'm willing to bet denormals still would have been an issue with this filter in some cases. Perhaps that's the path I couldn't find when debugging backscatter that led us to prerender audio for that intro? :)