Skip to content

Instantly share code, notes, and snippets.

@diegocasmo
Last active June 9, 2022 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save diegocasmo/ea865b8dae4421d1d80f491f0c4d8413 to your computer and use it in GitHub Desktop.
Save diegocasmo/ea865b8dae4421d1d80f491f0c4d8413 to your computer and use it in GitHub Desktop.
Pseudocode of the 'The Fast Fourier Transform Algorithm'
function FFT(A, ω)
Input: Coefficient representation of a polynomial A(x) of degree ≤ n − 1, where n is a power of 2
Output: Value representation A(ω^0), . . . , A(ω^n−1)
if ω = 1: return A(1)
express A(x) in the form Ae(x^2) + xAo(x^2)
call FFT(Ae, ω^2) to evaluate Ae at even powers of ω
call FFT(Ao, ω^2) to evaluate Ao at odd powers of ω
for j = 0 to n − 1:
compute A(ω^j) = Ae(ω^2j) + ω^jAo(ω^2j)
return A(ω^0), . . . , A(ω^n−1)
@diegocasmo
Copy link
Author

@Accacio
Copy link

Accacio commented Jun 9, 2022

I think there is a typo in line 8, shouldn't it be odd?

@diegocasmo
Copy link
Author

I think there is a typo in line 8, shouldn't it be odd?

Yes! It should be fixed now 🙂.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment