|
There is an FFT block in the Signal Processing Blockset is you have access to it.
Otherwise you could use either a MATLAB Fcn block or an S-Function.
Assuming the input signal is sample based (i.e. scalar at each time step), then the first thing you need to do is buffer the signal into an appropriate length vector before performing the fft.
Within an S-function you'd do that with a DWork vector.
Within a MATLAB Fcn block you'd need to use a persistent variable.
If you intend using the MATLAB fft function then within a MATLAB Fcn block you'll need to define fft as being coder.extrinsic.
Phil.
|