Package: dsp
Discrete Fourier transform
The FFT
object computes the discrete Fourier
transform (DFT) of an input. The object uses one or more of the following
fast Fourier transform (FFT) algorithms depending on the complexity
of the input and whether the output is in linear or bitreversed order:
Doublesignal algorithm
Halflength algorithm
Radix2 decimationintime (DIT) algorithm
Radix2 decimationinfrequency (DIF) algorithm
To compute the DFT of an input:
Define and set up your FFT
object.
See Construction.
Call step
to compute the DFT of the input according
to the properties of dsp.FFT
. The behavior of step
is
specific to each object in the toolbox.
H = dsp.FFT
returns
a FFT
object, H
, that computes the
DFT of an ND array. For column vectors or multidimensional
arrays, the FFT
object computes the DFT along the
first dimension. If the input is a row vector, the FFT
object
computes a row of singlesample DFTs and issues a warning.
H = dsp.FFT('
returns a PropertyName
',PropertyValue
,
...)FFT
object, H
,
with each property set to the specified value.

FFT implementation Specify the implementation used for the FFT as one of 

Order of output elements relative to input elements Designate order of output channel elements relative to order
of input elements. Set this property to 

Divide butterfly outputs by two Set this property to The default value of this property is 

Source of FFT length Specify how to determine the FFT length as 

FFT length Specify the FFT length. This property applies when you set the This property must be a power of two when the input is a fixedpoint
data type, or when you set the 

Boolean value of wrapping or truncating input Wrap input data when FFT length is shorter than input length.
If this property is set to true, modulolength data wrapping occurs
before the FFT operation, given FFT length is shorter than the
input length. If this property is set to false, truncation of the
input data to the FFT length occurs before the FFT operation. The
default is

clone  Create FFT object with same property values 
getNumInputs  Number of expected inputs to step method 
getNumOutputs  Number of outputs of step method 
isLocked  Locked status for input attributes and nontunable properties 
release  Allow property value and input characteristics changes 
step  Discrete Fourier transform of input 
Find frequency components of a signal in additive noise:
Fs = 800; L = 1000; t = (0:L1)'/Fs; x = sin(2*pi*250*t) + 0.75*cos(2*pi*340*t); y = x + .5*randn(size(x)); % noisy signal hfft = dsp.FFT('FFTLengthSource', 'Property', ... 'FFTLength', 1024); Y = step(hfft, y); % Plot the singlesided amplitude spectrum plot(Fs/2*linspace(0,1,512), 2*abs(Y(1:512)/1024)); title('Singlesided amplitude spectrum of noisy signal y(t)'); xlabel('Frequency (Hz)'); ylabel('Y(f)');
This object implements the algorithm, inputs, and outputs described on the FFT block reference page. The object properties correspond to the block parameters.
[1] FFTW (http://www.fftw.org
)
[2] Frigo, M. and S. G. Johnson, "FFTW: An Adaptive Software Architecture for the FFT,"Proceedings of the International Conference on Acoustics, Speech, and Signal Processing, Vol. 3, 1998, pp. 13811384.