Skip to content

Commit b88c300

Browse files
committed
audioreactive: workaround for ArduinoFFT bug 93
This fix works around a problem that was solved in upstream ArduinoFFT 2.0.2
1 parent b320612 commit b88c300

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

usermods/audioreactive/audio_reactive.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ void FFTcode(void * parameter)
282282
//FFT.windowing(FFTWindow::Blackman_Harris, FFTDirection::Forward); // Weigh data using "Blackman- Harris" window - sharp peaks due to excellent sideband rejection
283283
FFT.compute( FFTDirection::Forward ); // Compute FFT
284284
FFT.complexToMagnitude(); // Compute magnitudes
285+
vReal[0] = 0; // The remaining DC offset on the signal produces a strong spike on position 0 that should be eliminated to avoid issues.
285286

286287
FFT.majorPeak(&FFT_MajorPeak, &FFT_Magnitude); // let the effects know which freq was most dominant
287288
FFT_MajorPeak = constrain(FFT_MajorPeak, 1.0f, 11025.0f); // restrict value to range expected by effects

0 commit comments

Comments
 (0)