Skip to content

Commit

Permalink
Filter: only update notch on init if fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge authored and peterbarker committed Sep 8, 2024
1 parent 1ef89d3 commit 9726e8e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libraries/Filter/HarmonicNotchFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

_initialised = true;

// ensure static notches are allocated and working
update(center_freq_hz);
if (params->tracking_mode() == HarmonicNotchDynamicMode::Fixed) {
update(center_freq_hz);
}
}

/*
Expand Down

0 comments on commit 9726e8e

Please sign in to comment.