FFT – Fast Fourier Transform MatDeck software

Fast Fourier Transform – FFT is widely used for many applications in mathematics, engineering, and the world of technology. It is an algorithm that is used to calculate the frequency components of an input signal. FFT computes the discrete Fourier transform of an input sequence. It is essential to use an efficient algorithm for rapid calculations and decrease the algorithmic complexity from the original O(n2) to an effective O(nlogn).

MatDeck FFT functions

MatDeck’s fft1() function rapidly calculates the DFT of the input sequence, with speed comparable to other leading mathematical software, achieving 0.5 sec for a sequence length equal to one million samples. This speed is achieved using the “Build and Run Exe” option to execute the fft1() function. The ffti1 function () is used to compute the inverse discrete Fourier transform, and to move from the frequency domain to the time domain. ffti1() is also realized using very efficient algorithm as well. All MatDeck functions that rely on fft1() or ffti1() are extremely efficient in algorithmic sense. MatDeck’s fft2() function is used to determine the two-dimensional Fourier transform in an efficient manner.

FFT

MatDeck’s function fft1() rapidly calculates the DFT of the input sequence, with speed comparable to other leading mathematical software achieving 0.5 sec for the sequence length equal to one million samples.

MatDeck software FFT template 

This speed is MatDeck’s templates are shown below. The red boxes show where to find FFT templates and functions. Templates are ready-made pieces of code that need very little editing to be used of advanced and needed applications.

matdeck templates

FFT GPU software

MatDeck allows user to set GPU modes with ArrayFire. The better video card you use, the more noticeable the difference in execution time will be. This is clearly visible when you have larger matrices, FFT, convolution and more. ArrayFire supports all CUDA –capable NVIDIA video cards and OpenCL devices such as AMD video cards. The function that is used for MatDeck’s fft1() function is the ArrayFire afp_fft() function, which is part of the AF plugin. The corresponding two-dimensional function is afp_fft2(). There are also functions for inverse fast Fourier transforms afp_ifft(), and afp_ifft2(). Several other functions rely on the efficient implementation of afp_fft(), such as: afp_fft_convolve() and afp_fft_convolve,2 which are used for convolution as well as afp_fft_c2r() that is used for complex to real Fourier transform.

MatDeck FFT software options

There are several MatDeck examples that illustrate the use of FFT. There are also several different ways to implement FFT in MatDeck:

  • The fft1() function can be called directly into MatDeck Script code.
  • There is also the fft toolkit, where fft is called from intuitive and simple to use GUI.
  • For faster and larger sample, afp functions such as afp_fft() can be used.
  • For two dimensional signals, there are appropriate two-dimensional fft functions, in MatDeck and the ArrayFire group
  • Finally, MatDeck offers several Templates, which make FFT function and code available to be used in several clicks.
signal transforms toolkit
The Signal Transforms Toolkit
fft template
Use FFT template – one click coding: Insert – Select Templates – FFT – FFT with graph ready
arrayfire fft template
Use ArrayFire FFT template to calculate fft : Insert – Select Templates – FFT –ArrayFire FFT

In the example below, we can see how CUDA is used to speed up the execution of the code, the same can also be done with OpenCL, using ArrayFire functions.

cuda example

Examples