Optimize Generated Code for Fast Fourier Transform Functions
Code generated for Fast Fourier Transform (FFT) functions is deployable to multiple
target CPUs. To generate deployable code for your FFT functions, certain modifications
are required. Generate optimized code by using the FFT implementation and library
required by your target hardware. The code generator enables you to generate code for
MATLAB® FFT functions (fft
, fft2
, fftn
, ifft
, ifft2
, ifftn
) or optimize the generated code by using custom FFTW libraries
with MATLAB FFT functions. You can also generate code for DSP System Toolbox™ implementations, (dsp.FFT
(DSP System Toolbox) and dsp.IFFT
(DSP System Toolbox) ).
To generate fixed-point code for your FFT workflow, use the DSP System Toolbox implementations. These implementations have fixed-point properties that
are set according to your required FFT workflow. See dsp.FFT
(DSP System Toolbox).
Intel Target Support
You can deploy code generated for MATLAB FFT implementations and DSP System Toolbox implementations to Intel® target CPUs. The supported implementations provide input support as listed in this table.
FFT Implementation | Input Support | Reference |
---|---|---|
MATLAB FFT functions in standalone code |
| By default, the code generator produces standalone code for the FFT algorithms instead of producing FFT library calls. |
MATLAB FFT functions with custom FFTW libraries in standalone code |
Optimizations are dependent on target CPU data type support. | To use FFTW libraries for your target CPUs:
See Speed Up Fast Fourier Transforms in Generated Standalone Code by Using FFTW Library Calls. |
dsp.FFT (DSP System Toolbox) functions in
standalone C code |
| Does not support variable-size inputs without FFTW libraries. See
dsp.FFT (DSP System Toolbox). |
dsp.FFT (DSP System Toolbox) functions with
FFTW libraries in standalone C code |
| Set the
|
ARM Target Support
You can deploy code generated for MATLAB FFT implementations and DSP System Toolbox implementations to ARM® target CPUs. The supported implementations provide input support as listed in this table.
FFT Implementation | Input Support | Reference |
---|---|---|
MATLAB FFT functions in standalone code |
| By default, the code generator produces standalone code for the FFT algorithms instead of producing FFT library calls. See: |
MATLAB FFT functions with custom FFTW libraries in standalone code |
| To use FFTW libraries for your target CPUs:
|
dsp.FFT (DSP System Toolbox) functions in
standalone C code |
| Does not support variable-size inputs without FFTW libraries. |
dsp.FFT (DSP System Toolbox) functions with
CRL/support packages in standalone C code |
|
|
MEX Target Support
When generating MEX code for your Fast Fourier Transform functions, the supported implementations provide support as listed in this table.
FFT Implementation | Input Support | Reference |
---|---|---|
MATLAB FFT functions in MEX code |
| When you generated MEX code for FFT functions, the code generator uses MATLAB FFT algorithms. |
dsp.FFT (DSP System Toolbox) functions in
MEX code |
| Does not support variable-size inputs without FFTW libraries. |
dsp.FFT (DSP System Toolbox) functions with
FFTW libraries in MEX code |
| Set the 'FFTImplementation' property to
'FFTW' .
|
See Also
fft
| fft2
| fftn
| ifft
| ifft2
| ifftn
| dsp.FFT
(DSP System Toolbox) | dsp.IFFT
(DSP System Toolbox)
Related Topics
- Speed Up Fast Fourier Transforms in Generated Standalone Code by Using FFTW Library Calls
- Synchronize Multithreaded Access to FFTW Planning in Generated Standalone Code