12.07.2015 Views

Lode's Computer Graphics Tutorial Fourier Transform

Lode's Computer Graphics Tutorial Fourier Transform

Lode's Computer Graphics Tutorial Fourier Transform

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

And here's the Fast <strong>Fourier</strong> <strong>Transform</strong> again, in 2D this time. The same can be said about this functionas for the DFT2D function. The explanation of the FFT was already done in an earlier section.void FFT2D(int n, int m, bool inverse, double *gRe, double *gIm, double *GRe, double *GIm){int l2n = 0, p = 1; //l2n will become log_2(n)while(p < n) {p *= 2; l2n++;}int l2m = 0; p = 1; //l2m will become log_2(m)while(p < m) {p *= 2; l2m++;}m = 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!