This enhancement has been incorporated in Release 2011b (R2011b). For previous product releases, read below for any possible workarounds:
The ability to perform FFT on a non-power of 2 length signal using a Simulink block is not available in DSP System Toolbox (or Signal Processing Blockset).
To work around this issue, you can use an Embedded MATLAB function block and the eml.extrinsic function to call MATLAB’s FFT function. This will enable you to perform FFT computation on non-power of 2 length signals in Simulink. Below is an example of this procedure for performing an FFT on some signal x.
eml.extrinsic('fft');
y = complex(zeros(size(x),class(x)));
y = fft(x);
The first line tells the Embedded MATLAB compiler to call the FFT function from base MATLAB. The initialization of y just tells the Embedded MATLAB compiler how to dissect the mxArray that MATLAB will return so that it can be stored in an ordinary C array.
However, please note that this approach is not compatible with code generation using Real-Time Workshop or Simulink HDL Coder.
Best Answer