Skip to content

Commit

Permalink
Filter: Get common processes out of the way
Browse files Browse the repository at this point in the history
  • Loading branch information
muramura committed Apr 28, 2024
1 parent 0a3ff72 commit f5abac8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libraries/Filter/NotchFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ template <class T>
void NotchFilter<T>::init(float sample_freq_hz, float center_freq_hz, float bandwidth_hz, float attenuation_dB)
{
// check center frequency is in the allowable range
initialised = false;
if ((center_freq_hz > 0.5 * bandwidth_hz) && (center_freq_hz < 0.5 * sample_freq_hz)) {
float A, Q;
initialised = false; // force center frequency change
calculate_A_and_Q(center_freq_hz, bandwidth_hz, attenuation_dB, A, Q);
init_with_A_and_Q(sample_freq_hz, center_freq_hz, A, Q);
} else {
initialised = false;
}
}

Expand Down

0 comments on commit f5abac8

Please sign in to comment.