| Signal Processing Blockset™ | ![]() |
Compute nonparametric estimate of spectrum using periodogram method
Estimation / Power Spectrum Estimation
dspspect3
Transforms
dspxfrm3

The Magnitude FFT block computes a nonparametric estimate of the spectrum using the periodogram method.
When the Output parameter is set to Magnitude squared, the block output for an M-by-N input u is equivalent to
y = abs(fft(u,nfft)).^2 % M ≤ nfft
When the Output parameter is set to Magnitude, the block output for an input u is equivalent to
y = abs(fft(u,nfft)) % M ≤ nfft
When M > Nfft, the block wraps the input to Nfft before computing the FFT using one of the above equations:
y(:,k)=datawrap(u(:,k),nfft) % 1 ≤ k ≤ N
Both an M-by-N frame-based matrix input and an M-by-N sample-based matrix input are treated as M sequential time samples from N independent channels. The block computes a separate estimate for each of the N independent channels and generates an Nfft-by-N matrix output. When you select Inherit FFT length from input dimensions, Nfft is specified by the frame size of the input, which must be a power of 2. When you do not select Inherit FFT length from input dimensions, Nfft is specified as a power of 2 by the FFT length parameter, and the block zero pads or wraps the input to Nfft before computing the FFT.
Each column of the output matrix contains the estimate of the corresponding input column's power spectral density at Nfft equally spaced frequency points in the range [0,Fs), where Fs is the signal's sample frequency. The output is always sample based.
The block does not accept sample-based 1-by-N row vector inputs.
The Magnitude FFT block supports real and complex floating-point inputs. The block also supports real fixed-point inputs in both Magnitude and Magnitude squared modes, and complex fixed-point inputs in the Magnitude squared mode.
The Magnitude FFT block supports real and complex floating-point inputs. The block also supports real fixed-point inputs in both Magnitude and Magnitude squared modes, and complex fixed-point inputs in the Magnitude squared mode.
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
Round integer calculations toward — 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:
Round integer calculations toward — Floor
Saturate on integer overflow — checked
Output — Inherit via internal rule
The dspsacomp demo compares the periodogram method with several other spectral estimation methods.

Specify whether the block computes the magnitude FFT or magnitude-squared FFT of the input.
Select to use the input frame size as the number of data points, Nfft, on which to perform the FFT.
Enter the number of data points on which to perform the FFT, Nfft. When Nfft is larger than the input frame size, each frame is zero-padded as needed. When Nfft is smaller than the input frame size, each frame is wrapped as needed. This parameter is enabled when you clear the Inherit FFT length from input dimensions check box.
Oppenheim, A. V. and R. W. Schafer. Discrete-Time Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, 1989.
Orfanidis, S. J. Introduction to Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, 1995.
Proakis, J. and D. Manolakis. Digital Signal Processing. 3rd ed. Englewood Cliffs, NJ: Prentice-Hall, 1996.
| Port | Supported Data Types |
|---|---|
Input |
|
Output |
|
| Burg Method | Signal Processing Blockset |
| Short-Time FFT | Signal Processing Blockset |
| Spectrum Scope | Signal Processing Blockset |
| Yule-Walker Method | Signal Processing Blockset |
| pwelch | Signal Processing Toolbox |
See Power Spectrum Estimation for related information.
![]() | LU Solver | Matrix 1-Norm | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |