Generally, I can reproduce the output, including the funny noises on Pd-0.52.1 64-bit.
IOhannes z. and Chrostof R. figured out, it depends on compiler options -ffast-math and / or -fassociative-math.
That's only half the story. Generally, one shouldn't expect floating point computations to yield the exact same result with different compilers/machines. The rounding errors themselves are very small, but they can accumulate over long periods of time or get amplified by recursive algorithms.
However, in this case, the actual problem is really the implementation of [biquad~]. It uses direct form 2 - which requires fewer delay units, but is less numerically stable. (https://en.wikipedia.org/wiki/Digital_biquad_filter)
I've made an alternative implementation [biquad2~] that uses direct form
attachments.
Christof
On 10.02.2022 14:01, musil@iem.at wrote:
ISSUE: floating-point-inaccuracy of low frequency filters with low frequency signals in pd vanilla
The patch "Test_HP3_butterworth_@_20_Hz.pd" is part of the Live Electronic of K.H.Stockhausens piece Mikrophonie I. My colleague David P. told me, that there occur hearable noise, distortion, oscillations and rustling during perfoming this piece.
The test-patch is a 0.1 Hz oscillator sourcing a highpass filter 3.order with butterworth characteristic at 20 Hz.
Try this patch with pd-0.52-1-msw-i386 and amd64 aka 32-bit and 64-bit and older pd versions. The 32 bit version has 20 dB less noise than the 64 bit version (and no oscillations).
Double precision filters of iemlib ("hp3_butt_dp~.pd") have less noise than single precision filters.
IOhannes z. and Chrostof R. figured out, it depends on compiler options -ffast-math and / or -fassociative-math.
Some screenshots are added.
have fun
Thomas Musil
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list