Main Content

Spectral Analysis

Parametric and nonparametric methods

The frequency-domain representation of a signal reveals important signal characteristics that are difficult to analyze in the time domain. Spectral analysis lets you characterize the frequency content of a signal. Perform real-time spectral analysis of a dynamic signal using the spectrumAnalyzer object in MATLAB® and the Spectrum Analyzer block in Simulink®. The Spectrum Analyzer uses the filter bank method or the Welch's method of averaging modified periodogram to compute the spectral data. Both these methods are FFT-based spectral estimation methods that make no assumptions about the input data and can be used with any kind of signal. For more information on the algorithm the Spectrum Analyzer uses, see Spectral Analysis. In addition to viewing the spectrum, you can also view the spectrogram of the signal in the Spectrum Analyzer. For an example, see View the Spectrogram Using Spectrum Analyzer.

If you want to acquire this data for post processing in MATLAB, call isNewDataReady and getSpectrumData object functions on the Spectrum Analyzer object. By calling these functions in the streaming loop, you can acquire the entire spectral data. In Simulink, to acquire the spectral data, create a SpectrumAnalyzerConfiguration object and run the getSpectrumData function on this object. Note that in Simulink, you can acquire only the last frame of the spectral data shown on the Spectrum Analyzer.

Alternately, you can use the dsp.SpectrumEstimator System object™ and Spectrum Estimator block to compute the power spectrum and acquire the spectral data for further processing. To view the spectral data computed by the spectrum estimator, use an array plot. For examples, see Estimate the Power Spectrum in MATLAB and Estimate the Power Spectrum in Simulink.

Objects

expand all

spectrumAnalyzerDisplay frequency spectrum of time-domain signals (Since R2022a)
dsp.SpectrumEstimatorEstimate power spectrum or power density spectrum
dsp.CrossSpectrumEstimatorEstimate cross-spectral density
dsp.TransferFunctionEstimatorEstimate transfer function

Blocks

expand all

Burg MethodPower spectral density estimate using Burg method
Covariance MethodPower spectral density estimate using covariance method
Cross-Spectrum EstimatorEstimate cross-power spectrum density
Discrete Transfer Function EstimatorCompute estimate of frequency-domain transfer function of system
Magnitude FFTCompute nonparametric estimate of spectrum using periodogram method
Modified Covariance MethodPower spectral density estimate using modified covariance method
PeriodogramPower spectral density or mean-square spectrum estimate using periodogram method
Short-Time FFTNonparametric estimate of spectrum using short-time fast Fourier transform (STFT) method
Spectrum AnalyzerDisplay frequency spectrum
Spectrum EstimatorEstimate power spectrum or power-density spectrum
Yule-Walker MethodPower spectral density estimate using Yule-Walker method
Burg AR EstimatorCompute estimate of autoregressive (AR) model parameters using Burg method
Covariance AR EstimatorCompute estimate of autoregressive (AR) model parameters using covariance method
Modified Covariance AR EstimatorCompute estimate of autoregressive (AR) model parameters using modified covariance method
Yule-Walker AR EstimatorCompute estimate of autoregressive (AR) model parameters using Yule-Walker method

Topics