I'm at a loss on how to solve this issue
. I'm processing samples from a microphone using the ArduinoFFT library functions, but I keep encountering an overflow of the real component (vReal). I've even replaced all real components in the code with a fixed number, but in every iteration, the vReal array still uncontrollably increases for some reason.
Here's the part of the code in the loop:
for (int i = 0; i < SAMPLES; i++) {
vReal[i] = 0.5;
vImag[i] = 0.0;
}
Serial.print(String(vReal[0]) + "\t");
FFT.dcRemoval();
Serial.print(String(vReal[0]) + "\t");
FFT.windowing(FFT_WIN_TYP_HAMMING, FFT_FORWARD);
Serial.print(String(vReal[0]) + "\t");
FFT.compute(FFT_FORWARD);
Serial.print(String(vReal[0]) + "\t");
FFT.complexToMagnitude();
Serial.print(String(vReal[0]));
And here is the output showing that the numbers are increasing, causing my microcontroller to crash:
|18:30:53.472 -> 0.50|0.50|0.04|12.99|19.68|19.68|
|---|---|---|---|---|---|
|18:30:54.030 -> 0.50|0.50|0.04|500.93|502.60|502.60|
|18:30:54.525 -> 0.50|0.50|0.04|10780.87|10820.21|10820.21|
|18:30:55.025 -> 0.50|0.50|0.04|173699.20|174900.83|190227.47|
|18:30:55.581 -> 0.50|0.50|0.04|3018009.00|3023591.75|3023591.75|
|18:30:56.092 -> 0.50|0.50|0.04|64106664.00|64131624.00|64131624.00|
|18:30:56.593 -> 0.50|0.50|0.04|1334393856.00|1344235264.00|1344235264.00|
|18:30:57.106 -> 0.50|0.50|0.04|20313952256.00|20314204160.00|ovf|
|18:30:57.620 -> 0.50|0.50|0.04|414506221568.00|414621466624.00|ovf|
|18:30:58.149 -> 0.50|0.50|0.04|6874642513920.00|6897976475648.00|ovf|
|18:30:58.635 -> 0.50|0.50|0.04|125691672657920.00|125765576294399.99|ovf|
|18:30:59.151 -> 0.50|0.50|0.04|2255658304929792.02|2262543405940736.10|ovf|
|18:30:59.705 -> 0.50|0.50|0.04|35762689435238401.71|36074366621974527.36|ovf|
|18:31:00.220 -> 0.50|0.50|0.04|806934263684399155.63|809745233880285120.16|ovf|
|18:31:00.699 -> 0.50|0.50|0.04|16730721982588388385.69|16747550008051499403.90|ovf|
|18:31:01.247 -> 0.50|0.50|0.04|303674802570709179150.29|inf|inf|
|18:31:01.760 -> 0.50|0.50|0.04|nan|nan|0.00|
|18:31:02.248 -> 0.50|0.50|0.04|nan|nan|0.00|
|18:31:02.803 -> 0.50|0.50|0.04|nan|nan|0.00|