Spectral analysis is the process of estimating the power spectral density (PSD) 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 density spectrum implied by the model.

The spectrum analyzer in DSP System Toolbox™ uses Welch's nonparametric method of averaging modified periodogram to estimate the power density spectrum of a streaming signal in real time.

**Welch's Algorithm of Averaging
Modified Periodogram**

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 spectral density. Because the process is wide-sense stationary and Welch's method uses PSD estimates of different segments of the time series, the modified periodograms represent approximately uncorrelated estimates of the true PSD. 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 the
Spectrum Analyzer block, you can specify the window using the **Window** parameter.

The algorithm in the Spectrum Analyzer block consists of these steps:

The block buffers the input into

*N*point data segments. Each data segment is split up into*L*overlapping data segments, each of length*M*, overlapping by*D*points. The data segments can be represented as:$$\begin{array}{l}{x}_{i}(n)=x(n+iD),\text{\hspace{1em}}\text{\hspace{0.05em}}n=0,1,\mathrm{...},M-1\\ \text{\hspace{1em}}\text{\hspace{1em}}\text{\hspace{1em}}\text{\hspace{1em}}\text{\hspace{1em}}\text{\hspace{1em}}\text{\hspace{1em}}\text{\hspace{1em}}i=0,1,\mathrm{...},L-1\end{array}$$

If

*D*=*M*/2, the overlap is 50%.If

*D*= 0, the overlap is 0%.

The block uses the

`RBW`

or the`Window Length`

setting in the**Spectrum Settings**pane 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 (

*N*) to compute a spectral estimate. This number of input samples required to compute one spectral update is shown as_{samples}**Samples/update**in the**Main options**pane. This value is directly related to the resolution bandwidth,*RBW*, by the following equation:$${N}_{samples}=\frac{\left(1-\frac{Overlap}{100}\right)*NENBW*{F}_{s}}{RBW}$$.

*Overlap*, the amount of overlap (%) between the previous and current buffered data segments, is specified through the**Overlap (%)**parameter in the**Window options**pane.*NENBW*, the normalized effective noise bandwidth of the window depends on the windowing method. This parameter is shown in the**Window options**pane.*F*is the sample rate of the input signal._{s}

When in

`RBW`

mode, the window length required to compute one spectral update,*N*, is directly related to the resolution bandwidth and normalized effective noise bandwidth:_{window}When in

`Window length`

mode, the window length is used as specified.The number of input samples required to compute one spectral update,

*N*, is directly related to the window length and the amount of overlap:_{samples}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**N*_{samples}0% 100 50% 50 80% 20 The normalized effective noise bandwidth,

*NENBW*, is a window parameter determined by the window length,*N*, and the type of window used. If_{window}*w*(*n*) denotes the vector of*N*window coefficients, then_{window}*NENBW*is:When in RBW mode, you can set the resolution bandwidth using the value of the

**RBW**parameter on the**Main options**pane. 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:$$\frac{span}{RBW}>2$$

By default, the

**RBW**parameter on the**Main options**pane is set to`Auto`

. 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 set**RBW**to`Auto`

, RBW is calculated by: $$RB{W}_{auto}=\frac{span}{1024}$$When in window length mode, you specify

*N*and the resulting RBW is_{window}.

Apply a window to each of the

*L*overlapping 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}_{xx}^{i}(f)=\frac{1}{MU}{\left|{\displaystyle \sum _{n=0}^{M-1}{x}_{i}(n)w(n){e}^{-j2\pi fn}}\right|}^{2},\text{\hspace{1em}}\text{\hspace{1em}}i=0,1,\mathrm{...},L-1$$

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

$$U=\frac{1}{M}{\displaystyle \sum _{n=0}^{M-1}{w}^{2}(n)}$$

.

You can specify the window using the

**Window**parameter.To determine the Welch power spectrum estimate, the Spectrum Analyzer block averages the result of the periodograms for the last

*L*data segments. The averaging reduces the variance, compared to the original*N*point data segment.$${P}_{xx}^{W}(f)=\frac{1}{L}{\displaystyle \sum _{i=0}^{L-1}{P}_{xx}^{i}(f)}$$

*L*is specified through the**Averages**parameter in the**Trace options**pane.The Spectrum Analyzer block computes the power spectral density using:

$${P}_{xx}^{W}(f)=\frac{1}{L*{F}_{s}}{\displaystyle \sum _{i=0}^{L-1}{P}_{xx}^{i}(f)}$$

.

[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 Modeling.* Hoboken, NJ: John Wiley &
Sons, 1996.

Was this topic helpful?