Filter: only update notch on init if fixed

This commit is contained in:
Andrew Tridgell 2024-09-08 18:10:57 +10:00 committed by Peter Barker
parent 1ef89d31f2
commit 9726e8e218
1 changed files with 4 additions and 1 deletions

View File

@ -191,8 +191,11 @@ void HarmonicNotchFilter<T>::init(float sample_freq_hz, HarmonicNotchFilterParam
NotchFilter<T>::calculate_A_and_Q(center_freq_hz, bandwidth_hz / _composite_notches, attenuation_dB, _A, _Q); NotchFilter<T>::calculate_A_and_Q(center_freq_hz, bandwidth_hz / _composite_notches, attenuation_dB, _A, _Q);
_initialised = true; _initialised = true;
// ensure static notches are allocated and working // ensure static notches are allocated and working
update(center_freq_hz); if (params->tracking_mode() == HarmonicNotchDynamicMode::Fixed) {
update(center_freq_hz);
}
} }
/* /*