Skip to content

Commit

Permalink
cutoffMult max value of 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Quick-Flash authored May 24, 2022
1 parent c1fde63 commit 3a3d51b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/flight/dyn_notch_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ static FAST_CODE_NOINLINE void dynNotchProcess(void)
// Convert bin to frequency: freq = bin * binResoultion (bin 0 is 0Hz)
const float centerFreq = constrainf(meanBin * sdftResolutionHz, dynNotch.minHz, dynNotch.maxHz);

// PT1 style smoothing moves notch center freqs rapidly towards big peaks and slowly away, up to 10x faster
const float cutoffMult = constrainf(peaks[p].value / sdftNoiseThreshold, 1.0f, 10.0f);
// PT1 style smoothing moves notch center freqs rapidly towards big peaks and slowly away, up to 5x faster
const float cutoffMult = constrainf((peaks[p].value * 0.5) / sdftNoiseThreshold, 1.0f, 5.0f);
const float gain = pt1FilterGain(DYN_NOTCH_SMOOTH_HZ * cutoffMult, pt1LooptimeS); // dynamic PT1 k value

// Finally update notch center frequency p on current axis
Expand Down

0 comments on commit 3a3d51b

Please sign in to comment.