Skip to content

Commit

Permalink
audioreactive: workaround for ArduinoFFT bug 93
Browse files Browse the repository at this point in the history
This fix works around a problem that was solved in upstream ArduinoFFT 2.0.2
  • Loading branch information
softhack007 committed May 7, 2024
1 parent b320612 commit b88c300
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions usermods/audioreactive/audio_reactive.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ void FFTcode(void * parameter)
//FFT.windowing(FFTWindow::Blackman_Harris, FFTDirection::Forward); // Weigh data using "Blackman- Harris" window - sharp peaks due to excellent sideband rejection
FFT.compute( FFTDirection::Forward ); // Compute FFT
FFT.complexToMagnitude(); // Compute magnitudes
vReal[0] = 0; // The remaining DC offset on the signal produces a strong spike on position 0 that should be eliminated to avoid issues.

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

0 comments on commit b88c300

Please sign in to comment.