With the addition of the Martin Vicanek matched second order BPF filter option, it becomes apparent double precision math isn't good enough for coefficient calculation in all cases. Here is an example. Starting with version 1.40, all filter coefficient calculations are done with mpfr 128 bit precision math and trig functions.
New command line arguments rlcdumpcoef=
and mpfrcoef=
can be used to see the difference:
sv generate out.wav f64 16000 0.00025 sine 1.0 4000
sv out.wav freqscale=log q=5 minfreq=5 rlcselect=2 rlcdumpcoef=5 exit mpfrcoef=1
f0=5.0185Hz Q=2.1749
a0=0.000822624571392692
a1=-0.000739522539124063
a2=-0.000083102032268629
b1=-1.999090390986266730
b2=0.999094273103194430
sv out.wav freqscale=log q=5 minfreq=5 rlcselect=2 rlcdumpcoef=5 exit mpfrcoef=0
f0=5.0185Hz Q=2.1749
a0=0.000822547471038967
a1=-0.000739368337667973
a2=-0.000083179133370994
b1=-1.999090390986266952
b2=0.999094273103194430