[LAD] Converting single-cycle wave to harmonic spectrum

Fons Adriaensen fons at linuxaudio.org
Mon May 10 23:21:48 CEST 2021


On Mon, May 10, 2021 at 11:00:10PM +0200, Jeanette C. wrote:

> The output can be read as two halves:
> up to half the array:
> output[k] = real[k] the real part of the FFT
> The second half:
> output[size -k] = imaginary[k], the imaginary/complex part of the FFT
> The output shows 0 for the first to real values, but the same strength for
> the first two imaginary parts. Is this to be expected?

Yes. The sin() waves appear in the imaginary part, if you would
have used cos() instead that would show up in the real part. 
In general you will have both, and

* the amplitude is hypot (real, imag).
* the phase is atan2 (imag, real).

Ciao,

-- 
FA



More information about the Linux-audio-dev mailing list