In previous posts we have introduced the Fast Fourier Transform (FFT) on the GPU and shared a C++ AMP FTT Library. This post further demonstrates how to use multi-dimensional transformations, and inverse transformations.
Please follow these instructions to build and execute the test application.
The test is a command line program that receives a single parameter, which tells it what rank of transformation to test. That can be either “1” for 1d, “2” for 2d or “3” for 3d. In any case, the program generates an input vector with 10,000 float elements, according to an arbitrary (but visually appealing when rendered in Excel!) mathematical formula that you can change as you see fit. The sample code for performing the FFT transformations is contained in the function fft_sample() in the file driver.cpp. After the input vector is generated, a 1d, 2d or 3d array is populated using it, and is transformed. The transformed array is then inverse-transformed. The final result would be nearly identical to the original input.
Here is a snapshot of the Excel charts after applying a 1d transform:
And here are results of the 2d transformation for the same input data:
This concludes our discussion of FFTs for the time being. Please free to ask questions and provide feedback on our C++ AMP support forum.
Part I: Fast Fourier Transforms (FFT)on The GPU
Part II: C++ AMP FFT Library
Part III: C++ AMP FFT Test Application