We want to find discrete Fourier Transform
where
Add zeros at the end of
Now denote by
and by
Note that
We can now rewrite the original sum to get:
So we only take
Now if we do this recursively, we will only need
which is much faster than the naive approach.
Inverse
Basically the same idea but now we have:
so the recursive formula will be: