Engee documentation

Magnitude FFT

Performs non-parametric spectrum estimation using the periodogram method.

magnitude fft

Description

The Magnitude FFT block performs a Fourier transform (FFT) of the input signal and calculates the magnitude (modulus) of each component of the spectrum.

Ports

Input

# Input — input signal
vector | matrix

Details

Specify the input signal for a block as a vector or matrix of size to .

The block considers the input signal as a matrix of by as consecutive time samples from independent channels.

The Magnitude FFT block supports real and complex floating point input signals.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64

Complex numbers support

Yes

Output

# Output — Fast Fourier Transform (FFT) output value
vector | matrix

Details

FFT output value returned as a vector or matrix.

The block computes a separate estimate for each of the independent channels and generates to an output matrix. Each column of the output matrix contains an estimate of the power spectral density of the corresponding input column at equally spaced frequency points in the range , where represents the sampling frequency of the signal.

If the Output parameter is set to Magnitude squared, the block output for the input signal as a matrix to input is equivalent:

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

If the Output parameter is set to Magnitude squared, the block output for the input signal is equivalent:

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

If , then the block performs convolution of the input to before calculating the FFT using one of the above equations:

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

If , the block can also perform input truncation:

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

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64

Complex numbers support

No

Parameters

Parameters

# Output — output type
Magnitude squared | Magnitude

Details

Specify whether this block calculates the FFT of the magnitude or the FFT of the square of the magnitude of the input signal. For details on how this unit calculates the output signal depending on this setting, refer to the Output port description.

Values

Magnitude squared | Magnitude

Default value

Magnitude squared

Program usage name

Output

Tunable

No

Evaluatable

Yes

# FFT implementation — FFT realisation
Radix-2 | FFTW

Details

FFT Implementation:

  • FFTW - support input signal of arbitrary length.

  • Radix-2 - implementation of bitwise processing of fixed-point or floating-point data. The dimensionality of the input matrix with the size to must be equal to the power of two. To handle other input data dimensions, use the block Pad, to flatten or truncate these dimensions to powers of two, or, if possible, choose the FFTW implementation.

Values

Radix-2 | FFTW

Default value

Radix-2

Program usage name

FFTImplementation

Tunable

No

Evaluatable

Yes

# Inherit FFT length from input dimensions — inherit the FFT length from the input dimensions

Details

Select this check box to inherit the FFT length from the input dimensions. When this checkbox is selected, the input length must be equal to a power of two.

If this checkbox is not selected, the FFT length parameter becomes available to specify the length of the FFT.

Default value

false (switched off)

Program usage name

InheritFFTLength

Tunable

No

Evaluatable

Yes

# FFT length — FFT length

Details

Enter the number of data points , on which the FFT will be performed. If is larger than the input frame size, the block fills each frame with zeros as necessary. If is smaller than the input frame size, the block performs convolution for each frame as needed.

If the FFT implementation parameter is set to Radix-2, the FFT length value must be equal to degree 2.

Dependencies

To use this parameter, uncheck Inherit FFT length from input dimensions.

Default value

256

Program usage name

FFTLength

Tunable

No

Evaluatable

Yes

# Wrap input data when FFT length is shorter than input length — Selecting whether to convolve or truncate the input signal

Details

Select the input signal convolution or truncation depending on the FFT length setting.

If this checkbox is selected and FFT length is shorter than the length of the input data, the data is convolved modulo length before the FFT operation. If this checkbox is unchecked, the block truncates the input signal to FFT length before performing the FFT.

Default value

true (switched on)

Program usage name

WrapInput

Tunable

No

Evaluatable

Yes

Bibliography

  1. FFTW (https://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. 1381-1384.

  3. Oppenheim, A. V. and R. W. Schafer. Discrete-Time Signal Processing. 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.

Additional options

C code generation: Yes