Skip to content

Commit 7dc6659

Browse files
committed
audioreactive: better do DC removal after FFT.complexToMagnitude();
1 parent 0e0728b commit 7dc6659

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

usermods/audioreactive/audio_reactive.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,8 @@ void FFTcode(void * parameter)
601601
FFT.windowing(FFTWindow::Blackman_Harris, FFTDirection::Forward); // Weigh data using "Blackman- Harris" window - sharp peaks due to excellent sideband rejection
602602
#endif
603603
FFT.compute( FFTDirection::Forward ); // Compute FFT
604-
vReal[0] = 0; // The remaining DC offset on the signal produces a strong spike on position 0 that should be eliminated to avoid issues.
605604
FFT.complexToMagnitude(); // Compute magnitudes
605+
vReal[0] = 0; // The remaining DC offset on the signal produces a strong spike on position 0 that should be eliminated to avoid issues.
606606
#else
607607
FFT.DCRemoval(); // let FFT lib remove DC component, so we don't need to care about this in getSamples()
608608

0 commit comments

Comments
 (0)