ref: 2c63c24f340189fc3186ccd8806d5cf1ea56b835
parent: 699f50c2ce011da1531fc47f40b977d0efcb778e
author: robs <robs>
date: Wed Mar 11 16:55:33 EDT 2009
plot coefs should be double precision for an IIR
--- a/src/biquad.c
+++ b/src/biquad.c
@@ -73,7 +73,7 @@
"%% GNU Octave file (may also work with MATLAB(R) )\n"
"Fs=%g;minF=10;maxF=Fs/2;\n"
"sweepF=logspace(log10(minF),log10(maxF),200);\n"
- "[h,w]=freqz([%g %g %g],[1 %g %g],sweepF,Fs);\n"
+ "[h,w]=freqz([%.15e %.15e %.15e],[1 %.15e %.15e],sweepF,Fs);\n"
"semilogx(w,20*log10(h))\n"
"title('SoX effect: %s gain=%g frequency=%g %s=%g (rate=%g)')\n"
"xlabel('Frequency (Hz)')\n"
@@ -94,7 +94,7 @@
"set xlabel 'Frequency (Hz)'\n"
"set ylabel 'Amplitude Response (dB)'\n"
"Fs=%g\n"
- "b0=%g; b1=%g; b2=%g; a1=%g; a2=%g\n"
+ "b0=%.15e; b1=%.15e; b2=%.15e; a1=%.15e; a2=%.15e\n"
"o=2*pi/Fs\n"
"H(f)=sqrt((b0*b0+b1*b1+b2*b2+2.*(b0*b1+b1*b2)*cos(f*o)+2.*(b0*b2)*cos(2.*f*o))/(1.+a1*a1+a2*a2+2.*(a1+a1*a2)*cos(f*o)+2.*a2*cos(2.*f*o)))\n"
"set logscale x\n"