Main Content

Spectral Analysis

Spectral analysis is the process of estimating the power spectrum (PS) of a signal from its time-domain representation. Spectral density characterizes the frequency content of a signal or a stochastic process. Intuitively, the spectrum decomposes the signal or the stochastic process into the different frequencies, and identifies periodicities. The most commonly used instrument for performing spectral analysis is the spectrum analyzer.

Spectral analysis is done based on the nonparametric methods and the parametric methods. Nonparametric methods are based on dividing the time-domain data into segments, applying Fourier transform on each segment, computing the squared-magnitude of the transform, and summing and averaging the transform. Nonparametric methods such as modified periodogram, Bartlett, Welch, and the Blackman-Tukey methods, are a variation of this approach. These methods are based on measured data and do not require prior knowledge about the data or the model. Parametric methods are model-based approaches. The model for generating the signal can be constructed with a number of parameters that can estimated from the observed data. From the model and estimated parameters, the algorithm computes the power spectrum implied by the model.

The spectrum analyzer in DSP System Toolbox™ uses the Welch’s nonparametric method of averaging modified periodogram and the filter bank method to estimate the power spectrum of a streaming signal in real time. You can launch the spectrum analyzer using thedsp.SpectrumAnalyzerSystem object™ in MATLAB®and theSpectrum Analyzerblock in Simulink®.

Welch’s Algorithm of Averaging Modified Periodograms

To use the Welch method in the spectrum analyzer, set theMethodparameter toWelch. The Welch's technique to reduce the variance of the periodogram breaks the time series into overlapping segments. This method computes a modified periodogram for each segment and then averages these estimates to produce the estimate of the power spectrum. Because the process is wide-sense stationary and Welch's method uses PS estimates of different segments of the time series, the modified periodograms represent approximately uncorrelated estimates of the true PS. The averaging reduces the variability.

The segments are multiplied by a window function, such as a Hann window, so that Welch's method amounts to averaging modified periodograms. Because the segments usually overlap, data values at the beginning and end of the segment tapered by the window in one segment, occur away from the ends of adjacent segments. The overlap guards against the loss of information caused by windowing. In theSpectrum Analyzer块,您可以指定使用的窗口Windowparameter.

The algorithm in theSpectrum Analyzerblock consists of these steps:

  1. The block buffers the input intoNpoint data segments. Each data segment is split up intoLoverlapping data segments, each of lengthM, overlapping byDpoints. The data segments can be represented as:

    x i ( n ) = x ( n + i D ) , n = 0 , 1 , ... , M 1 i = 0 , 1 , ... , L 1

    • IfD=M/2, the overlap is 50%.

    • IfD= 0, the overlap is 0%.

    The block uses theRBWor theWindow Lengthsetting in theSpectrum Settingspane to determine the data window length. Then, it partitions the input signal into a number of windowed data segments.

    The spectrum analyzer requires a minimum number of samples (Nsamples) to compute a spectral estimate. This number of input samples required to compute one spectral update is shown as样品/更新in theMain optionspane. This value is directly related to the resolution bandwidth,RBW, by the following equation:

    N s a m p l e s = ( 1 O p 100 ) × N E N B W × F s R B W .

    • Op, the amount of overlap (%) between the previous and current buffered data segments, is specified through theOverlap (%)parameter in theWindow optionspane.

    • NENBW, the normalized effective noise bandwidth of the window depends on the windowing method. This parameter is shown in theWindow optionspane.

    • Fsis the sample rate of the input signal.

    When inRBWmode, the window length required to compute one spectral update,Nwindow, is directly related to the resolution bandwidth and normalized effective noise bandwidth:

    N w i n d o w = N E N B W × F s R B W

    When inWindow lengthmode, the window length is used as specified.

    The number of input samples required to compute one spectral update,Nsamples, is directly related to the window length and the amount of overlap:

    N s a m p l e s = ( 1 O p 100 ) N w i n d o w

    When you increase the overlap percentage, fewer new input samples are needed to compute a new spectral update. For example, the table shows the number of input samples required to compute one spectral update when the window length is 100.

    Overlap Nsamples
    0% 100
    50% 50
    80% 20

    The normalized effective noise bandwidth,NENBW, is a window parameter determined by the window length,Nwindow, and the type of window used. Ifw(n) denotes the vector ofNwindowwindow coefficients, thenNENBWis:

    N E N B W = N w i n d o w × n = 1 N w i n d o w w 2 ( n ) [ n = 1 N w i n d o w w ( n ) ] 2

    When in RBW mode, you can set the resolution bandwidth using the value of theRBWparameter on theMain optionspane. You must specify a value so that there are at least two RBW intervals over the specified frequency span. The ratio of the overall span to RBW must be greater than two:

    s p a n R B W > 2

    By default, theRBWparameter on theMain optionspane is set toAuto. In this case, the Spectrum Analyzer determines the appropriate value so that there are 1024 RBW intervals over the specified frequency span. Thus, when you setRBWtoAuto, RBW is calculated by: R B W a u t o = s p a n 1024

    When in window length mode, you specifyNwindowand the resulting RBW is

    N E N B W × F s N w i n d o w .

  2. Apply a window to each of theLoverlapping data segments in the time domain. Most window functions afford more influence to the data at the center of the set than to the data at the edges, which represents a loss of information. To mitigate that loss, the individual data sets are commonly overlapped in time. For each windowed segment, compute the periodogram by computing the discrete Fourier transform. Then compute the squared magnitude of the result, and divide the result by M.

    P x x i ( f ) = 1 M U | n = 0 M 1 x i ( n ) w ( n ) e j 2 π f n | 2 , i = 0 , 1 , ... , L 1

    whereUis a normalization factor for the power in the window function and is given by

    U = 1 M n = 0 M 1 w 2 ( n )

    .

    You can specify the window using theWindowparameter.

  3. To determine the Welch power spectrum estimate, the Spectrum Analyzer block averages the result of the periodograms for the lastLdata segments. The averaging reduces the variance, compared to the originalNpoint data segment.

    P x x W ( f ) = 1 L i = 0 L 1 P x x i ( f )

    Lis specified through theAveragesparameter in theTrace optionspane.

  4. 的Spectrum Analyzer block computes the power spectral density using:

    P x x W ( f ) = 1 L * F s i = 0 L 1 P x x i ( f )

    .

Filter Bank

在频谱使用滤波器组的方法alyzer, set theMethodparameter toFilter bank. In the filter bank approach, the analysis filter bank splits the broadband input signal into multiple narrow subbands. The spectrum analyzer computes the power in each narrow frequency band and the computed value is the spectral estimate over the respective frequency band. For signals with relatively small length, the filter bank approach produces a spectral estimate with a higher resolution, a more accurate noise floor, and peaks more precise than the Welch method, with low or no spectral leakage. These advantages come at the expense of increased computation and slower tracking.

For information on how the filter bank computes the power, see theAlgorithmssection indsp.SpectrumEstimator. For more information on the analysis filter bank and how it is implemented, see theMore Aboutand theAlgorithm部分dsp.Channelizer.

References

[1] Proakis, John G., and Dimitris G. Manolakis.Digital Signal Processing. 3rd ed. Upper Saddle River, NJ: Prentice Hall, 1996.

[2] Hayes, Monson H.Statistical Digital Signal Processing and ModelingHoboken, NJ: John Wiley & Sons, 1996.

See Also

Objects

Blocks

Related Topics