swharden/FftSharp

-Infinity values in array

bitkidinc opened this issue · 1 comments

Great work on the library! I am processing a long piece of audio, cut up into segments for the FFTs. I noticed if the first segment is all zeros when you call Transform.FFTpower(allZeroArray) the entire array is turned to -Infinity. Maybe this is known/ by design? It just caused me some confusion since I am averaging all the segments together at the end, plus Scott plot throws an exception for -Infinity data.

Hi @bitkidinc, thanks for reporting this! However, I believe this is the intended behavior.

If the input data is all zeros, the output will be all zeros. Taking FFT power is taking the Log10 of the FFT, and Log(0) is undefined.