RosettaCodeData/Task/Fast-Fourier-transform/00-TASK.txt

13 lines
643 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
;Task:
Calculate the &nbsp; FFT &nbsp; (<u>F</u>ast <u>F</u>ourier <u>T</u>ransform) &nbsp; of an input sequence.
The most general case allows for complex numbers at the input
and results in a sequence of equal length, again of complex numbers.
If you need to restrict yourself to real numbers, the output should
be the magnitude &nbsp; (i.e.: &nbsp; sqrt(re<sup>2</sup> + im<sup>2</sup>)) &nbsp; of the complex result.
The classic version is the recursive CooleyTukey FFT. [http://en.wikipedia.org/wiki/CooleyTukey_FFT_algorithm Wikipedia] has pseudo-code for that.
Further optimizations are possible but not required.
<br><br>