Fix frequency accumulation again

This is a revert of commit 99d18abf updated for later changes. It seems
in that commit the calculation was changed to match the reversed dfreq
added in 1a7415a6, which itself was calculated incorrectly. Fix the
calculation of updated frequency and matching dfreq.
This commit is contained in:
Miroslav Lichvar
2014-01-09 16:34:59 +01:00
parent 8545ba733a
commit 60d0fa2993
2 changed files with 6 additions and 6 deletions

View File

@@ -282,7 +282,7 @@ slew_samples
if (coefs_valid) {
coef_seconds_fast += doffset;
coef_gain_rate = (1.0 + dfreq) * (1.0 + coef_gain_rate) - 1.0;
coef_gain_rate = (1.0 - dfreq) * coef_gain_rate + dfreq;
}
DEBUG_LOG(LOGF_RtcLinux, "dfreq=%.8f doffset=%.6f old_fast=%.6f old_rate=%.3f new_fast=%.6f new_rate=%.3f",