Skip to content

Commit c6a9727

Browse files
Quick-FlashnerdCopter
authored andcommitted
cutoffMult max value of 5
1 parent 60f37d3 commit c6a9727

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/flight/dyn_notch_filter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ static FAST_CODE_NOINLINE void dynNotchProcess(void)
356356
// Convert bin to frequency: freq = bin * binResoultion (bin 0 is 0Hz)
357357
const float centerFreq = constrainf(meanBin * sdftResolutionHz, dynNotch.minHz, dynNotch.maxHz);
358358

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

363363
// Finally update notch center frequency p on current axis

0 commit comments

Comments
 (0)