Return the correct value from biquad_filt()

If you turned set `debug = 1` in hairtunes, you'd quickly get a mess of
debug messages that showed bf_est_drift in bf_est_update() going quicky
out of range toward a float NaN value (usually negative). Clearly the
presence of this `out` variable in biquad_filt was meant to be used, not
marked as unused.
This commit is contained in:
Dan McGee
2012-02-24 15:52:54 -06:00
parent 74ed9c6fa2
commit 0a446a421d
+2 -2
View File
@@ -586,11 +586,11 @@ static void biquad_lpf(biquad_t *bq, double freq, double Q) {
static double biquad_filt(biquad_t *bq, double in) {
double w = in - bq->a[0]*bq->hist[0] - bq->a[1]*bq->hist[1];
double out __attribute__((unused)) = bq->b[1]*bq->hist[0] + bq->b[2]*bq->hist[1] + bq->b[0]*w;
double out = bq->b[1]*bq->hist[0] + bq->b[2]*bq->hist[1] + bq->b[0]*w;
bq->hist[1] = bq->hist[0];
bq->hist[0] = w;
return w;
return out;
}
static double bf_playback_rate = 1.0;