High-resolution FFT of a portion of a spectrum
DSP System Toolbox / Transforms
The Zoom FFT block computes the fast Fourier Transform (FFT) of a signal over a portion of frequencies in the Nyquist interval. By setting an appropriate decimation factor D, and sampling rate Fs, you can choose the bandwidth of frequencies to analyze BW, where BW = Fs/D. You can also select a specific range of frequencies to analyze in the Nyquist interval by choosing the center frequency of the desired band.
The resolution of a signal is the ratio of Fs and the FFT length (L). Using zoom FFT, you can retain the same resolution you would achieve with a full-size FFT on your original signal by computing a small FFT on a shorter signal. The shorter signal comes from decimating the original signal. The savings come from being able to compute a much shorter FFT while achieving the same resolution. For a decimation factor of D, the new sampling rate, Fsd, is Fs/D, and the new frame size (and FFT length) is Ld = L/D. The resolution of the decimated signal is Fsd/Ld = Fs/L. To achieve a higher resolution of the shorter band, use the original FFT length, L, instead of the decimated FFT length, Ld.
x — Data input
vector | matrix
Data input whose zoom FFT the block computes, specified as a vector or a matrix. The number of input rows must be a multiple of the decimation factor.
This block supports variable-size input signals, as long as the input frame size is a multiple of the decimation factor. That is, you can change the input frame size (number of rows) during the simulation. However, the number of channels (number of columns) must remain constant.
This port is unnamed until you select the Specify center frequency from input port parameter and click Apply.
Complex Number Support: Yes
Fc — Center frequency input
Center frequency of the desired band in Hz, passed through this input port as a real scalar in the range (– SampleRate/2, SampleRate/2). SampleRate is the input sample rate either inherited from the input signal or specified through the Input sample rate (Hz) parameter. This port appears only when you select the Specify center frequency from input port check box.
This port appears only when you select the Specify center frequency from input port check box and click Apply.
Port_1 — Zoom FFT output
vector | matrix
Zoom FFT output, returned as a vector or matrix. If you select the Inherit FFT Length from input dimensions check box, the output frame size equals the input frame size divided by the decimation factor. If you clear the Inherit FFT Length from input dimensions check box and specify the FFT length, the output frame size equals the specified FFT length. The output data type matches the input data type.
Complex Number Support: Yes
Decimation factor — Decimation factor
2 (default) | positive integer
Decimation factor, specified as a positive integer. This value specifies the factor by which the block reduces the bandwidth of the input signal. The number of rows in the input signal must be a multiple of the decimation factor.
Specify center frequency from input port — Flag to specify center frequency from input port
'off' (default) |
When you select this option and click Apply, the input port Fc appears on the block icon. You can pass the center frequency through this input port as a scalar.
Center frequency (Hz) — Center frequency
0 (default) | real scalar
Center frequency of the desired band in Hz, specified as a real scalar in the range (– SampleRate/2, SampleRate/2). SampleRate is the input sample rate either inherited from the input or specified through the Input sample rate (Hz) parameter.
This parameter applies when you clear the Specify center frequency from input port check box.
Inherit FFT Length from input dimensions — Flag to inherit FFT length from input dimensions
'on' (default) |
When you select this option, the FFT length is the ratio of the input frame size (number of rows in the input) and the Decimation factor.
FFT length — FFT length
64 (default) | positive scalar
FFT length, specified as a positive integer. The FFT length must be greater than or equal to the ratio of the frame size (number of input rows) and the Decimation factor.
This parameter applies when you clear the Inherit FFT Length from input dimensions check box.
Inherit Sample rate from input — Flag to inherit sample rate from input
'off' (default) |
When you clear this check box, the block inherits the sample rate from the input signal.
Input sample rate (Hz) — Input sample rate
44100 (default) | positive real scalar
Input sample rate in Hz, specified as positive real scalar.
Simulate using — Type of simulation to run
Interpreted execution (default) |
Type of simulation to run. You can set this parameter to:
Interpreted execution: Simulate model using the MATLAB® interpreter. This option shortens startup time.
Code generation: Simulate model using generated C code. The first time you run a simulation, Simulink® generates C code for the block. The C code is reused for subsequent simulations as long as the model does not change. This option requires additional startup time but provides faster subsequent simulations.
The zoom FFT algorithm leverages bandpass filtering before computing the FFT of the signal. The concept of bandpass filtering is that suppose you are interested in the band [F1, F2] of the original input signal, sampled at the rate Fs Hz. If you pass this signal through a complex (one-sided) bandpass filter centered at Fc = (F1+F2)/2, with the bandwidth BW = F2 – F1, and then downsample the signal by a factor of D = floor(Fs/BW), the desired band comes down to the baseband.
If Fc cannot be expressed in the form of k×Fs/D, where k is an integer, then the shifted, decimated spectrum is not centered at DC. In this case, the center frequency gets translated to Fd.
The complex bandpass filter is obtained by first designing a lowpass filter prototype and then multiplying the lowpass coefficients with a complex exponential. This algorithm uses a multirate, multistage FIR filter as the lowpass filter prototype. To obtain the bandpass filter, the coefficients of each stage are frequency shifted. The decimation factor is the cumulative decimation factor of each stage. The complex bandpass filter followed by the decimator are implemented using an efficient polyphase structure. For more details on the design of the complex bandpass filter from the multirate multistage FIR filter prototype, see Zoom FFT and Complex Bandpass Filter Design.
 Harris, F.J. Multirate Signal Processing for Communication Systems. Prentice Hall, 2004, pp. 208–209.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Introduced in R2017b