Main Content

Magnitude FFT

Compute nonparametric estimate of spectrum using periodogram method

Library

  • Estimation / Power Spectrum Estimation

    dspspect3

  • Transforms

    dspxfrm3

  • Magnitude FFT block

Description

The Magnitude FFT block computes a nonparametric estimate of the spectrum using the periodogram method.

When theOutputparameter is set toMagnitude squared, the block output for anM-by-Ninputuis equivalent to

y = abs(fft(u,nfft)).^2 % M ≤ nfft

When theOutputparameter is set toMagnitude, the block output for an inputuis equivalent to

y = abs(fft(u,nfft)) % M ≤ nfft

WhenM>Nfft, the block wraps the input toNfftbefore computing the FFT using one of the above equations:

y(:,k)=datawrap(u(:,k),nfft) % 1 ≤ k ≤ N

WhenM>Nfft, the block can also truncate the input:

y(:,k)=abs(fft(u,nfft)) % 1 ≤ k ≤ N

The block treats anM-by-Nmatrix input asMsequential time samples fromNindependent channels. The block computes a separate estimate for each of theNindependent channels and generates anNfft-by-Nmatrix output. Each column of the output matrix contains the estimate of the corresponding input column's power spectral density atNfftequally spaced frequency points in the range [0,Fs), whereFsrepresents the signal's sample frequency. The block always outputs sample–based data.

The Magnitude FFT block supports real and complex floating-point inputs. The block also supports real fixed-point inputs in bothMagnitudeandMagnitude squaredmodes, and complex fixed-point inputs in theMagnitude squaredmode.

Fixed-Point Data Types

The following diagram shows the data types used within the Magnitude FFT subsystem block for fixed-point signals.

The settings for the fixed-point parameters of the FFT block in the diagram above are as follows:

  • Sine table —Same word length as input

  • Integer rounding mode —Floor

  • Saturate on integer overflow — unchecked

  • Product output —Inherit via internal rule

  • Accumulator —Inherit via internal rule

  • Output —Inherit via internal rule

The settings for the fixed-point parameters of the Magnitude Squared block in the diagram above are as follows:

  • Integer rounding mode —Floor

  • Saturate on integer overflow — checked

  • Output —Inherit via internal rule

Parameters

Output

Specify whether the block computes the magnitude FFT or magnitude-squared FFT of the input.

FFT implementation

Set this parameter toFFTWto support an arbitrary length input signal. The block restricts generated code with FFTW implementation to MATLAB®host computers.

Set this parameter toRadix-2for bit-reversed processing, fixed or floating-point data, or for portable C-code generation using the金宝app®Coder™. The first dimensionM,输入的矩阵必须是2的幂。work with other input sizes, use thePadblock to pad or truncate these dimensions to powers of two, or if possible choose the FFTW algorithm.

Set this parameter toAutoto let the block choose the FFT implementation. For non-power-of-two transform lengths, the block restricts generated code to MATLAB host computers.

Inherit FFT length from input dimensions

Select to use the input frame size as the number of data points, on which to perform the FFT. When you select this check box, this number must be a power of two. When you do not select this check box, theFFT lengthparameter specifies the number of data points.

FFT length

Enter the number of data points on which to perform the FFT,Nfft. WhenNfftis larger than the input frame size, each frame is zero-padded as needed. WhenNfftis smaller than the input frame size, each frame is wrapped as needed. This parameter is enabled when you clear theInherit FFT length from input dimensionscheck box.

When you set theFFT implementationparameter toRadix-2, this value must be a power of two.

Wrap input data when FFT length is shorter than input length

Choose to wrap or truncate the input, depending on theFFT length. If this parameter is checked, modulo-length data wrapping occurs before the FFT operation, givenFFT lengthis shorter than the input length. If this property is unchecked, truncation of the input data to the FFT length occurs before the FFT operation. The default is checked.

Supported Data Types

Port Supported Data Types

Input

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed and unsigned)

  • 8-, 16-, and 32-bit signed integers

Output

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed only)

  • 8-, 16-, and 32-bit signed integers

References

[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. 1381-1384.

[3] Oppenheim, A. V. and R. W. Schafer.离散时间信号处理. Englewood Cliffs, NJ: Prentice-Hall, 1989.

[4] Orfanidis, S. J.Introduction to Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, 1995.

[5] Proakis, J. and D. Manolakis.Digital Signal Processing.3rd ed. Englewood Cliffs, NJ: Prentice-Hall, 1996.

Extended Capabilities

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced before R2006a