Main Content

Cross-Spectrum Estimator

Estimate cross-power spectrum density

  • Cross-Spectrum Estimator block

Libraries:
DSP System Toolbox / Estimation / Power Spectrum Estimation

Description

The Cross-Spectrum Estimator block estimates the cross-power spectrum density of two input signals, x and y, using Welch’s method of averaged modified periodograms. The block buffers the input data into overlapping segments. You can set the length of the data segment and the amount of data overlap between segments through the parameters in the block dialog box. The block computes the current power spectrum estimate by averaging the previous power spectrum estimates using the method you specify in the Averaging method parameter.

Ports

Input

expand all

Specify the first data input as a vector or a matrix. The block treats each column of the input signal as a separate channel. If the input is a two-dimensional signal, the first dimension represents the channel length (or frame size) and the second dimension represents the number of channels. If the input is a one-dimensional signal, then the block interprets it as a single-channel signal.

The inputs, x and y, must have the same size and data type.

Data Types: double | single
Complex Number Support: Yes

Specify the second data input as a vector or a matrix. The block treats each column of the input signal as a separate channel. If the input is a two-dimensional signal, the first dimension represents the channel length (or frame size) and the second dimension represents the number of channels. If the input is a one-dimensional signal, then the block interprets it as a single-channel signal.

The inputs, x and y, must have the same size and data type.

Data Types: double | single
Complex Number Support: Yes

Output

expand all

Cross-power spectrum density estimated by the block, returned as a vector or a matrix. The output has the same size and data type as the input signals.

Data Types: double | single
Complex Number Support: Yes

Parameters

expand all

Specify the source of the window length value as one of these:

  • Same as input frame length (default) — Window length is equal to the frame size of the input.

  • Specify on dialog — Window length is the value specified in Window length.

Specify the length of the window in samples that the block uses to compute the spectrum estimate as a positive integer greater than 2.

Dependencies

To enable this parameter, set Window length source to Specify on dialog.

Specify the percentage of overlap between successive data windows as a scalar in the range [0,100).

Specify the averaging method as:

  • Running –– In the running averaging method, the block computes an equally weighted average of a specified number of spectrum estimates defined by the Number of spectral averages parameter.

  • Exponential –– In the exponential method, the block computes the average over samples weighted by an exponentially decaying forgetting factor.

Select this check box to specify the forgetting factor from an input port. When you do not select this check box, you must specify the forgetting factor through the Forgetting factor parameter in the block dialog box.

Dependencies

To enable this parameter, set Averaging method to Exponential.

Specify the exponential weighting forgetting factor as a scalar in the range (0,1].

Dependencies

To enable this parameter, set Averaging method to Exponential and clear the Specify forgetting factor from input port parameter.

Specify the number of spectral averages as a positive integer. The spectrum estimator computes the current power spectrum estimate by averaging the last N power spectrum estimates, where N is the number of spectral averages defined in Number of spectral averages.

Dependencies

To enable this parameter, set Averaging method to Running.

Specify the source of the FFT length value as one of these:

  • Auto — FFT length is equal to the frame size of the input.

  • Property — FFT length is the value you specify in the FFT length parameter.

Specify the FFT length the block uses to compute the spectral estimates as a positive integer.

Dependencies

To enable this parameter, set FFT length source to Property.

Specify the window function for the cross-spectrum estimator as Chebyshev, Flat Top, Hamming, Hann, Kaiser, or Rectangular. The default value is Hann.

Specify the sidelobe attenuation of the window as a positive scalar in dB.

Dependencies

To enable this parameter, set Window function to Chebyshev or Kaiser.

Specify the frequency range of the cross-spectrum estimator as one of these:

  • Centered — The cross-spectrum estimator computes the centered two-sided spectrum of complex or real input signals, x and y. The length of the cross-spectrum estimate is equal to the FFT length. The block computes the spectrum estimate over the frequency range [-SampleRate/2 SampleRate/2], where SampleRate is the sample rate of the input signal.

  • One-sided — The cross-spectrum estimator computes the one-sided spectrum of real input signals, x and y. When the FFT length, NFFT is even, length of the cross-spectrum estimate is (NFFT/ 2) + 1, and is computed over the frequency range [0 SampleRate/2]. When the FFT length, NFFT is odd, length of the cross-spectrum estimate is (NFFT + 1)/ 2, and is computed over the frequency range [0 SampleRate/2].

  • Two-sided — The cross-spectrum estimator computes the two-sided spectrum of complex or real input signals, x and y. The length of the cross-spectrum estimate is equal to the FFT length. The spectrum estimate is computed over the frequency range [0 SampleRate].

When you select this check box, the block computes the sample rate as N/Ts, where N is the frame size of the input signal, and Ts is the sample time of the input signal. When you clear this check box, the block uses the value you specify in Sample rate (Hz). By default, this check box is selected.

Specify the sample rate of the input signal as a positive scalar.

Dependencies

To enable this parameter, clear the Inherit sample rate from input check box.

Specify the type of simulation to run as one of these:

  • 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.

Block Characteristics

Data Types

double | single

Multidimensional Signals

No

Variable-Size Signals

No

Algorithms

expand all

References

[1] Hayes, Monson H. Statistical Digital Signal Processing and Modeling. Hoboken, NJ: John Wiley & Sons, 1996.

[2] Kay, Steven M. Modern Spectral Estimation: Theory and Application. Englewood Cliffs, NJ: Prentice Hall, 1999.

[3] Stoica, Petre, and Randolph L. Moses. Spectral Analysis of Signals. Englewood Cliffs, NJ: Prentice Hall, 2005.

[4] Welch, P. D. ''The Use of Fast Fourier Transform for the Estimation of Power Spectra: A Method Based on Time Averaging Over Short Modified Periodograms''. IEEE Transactions on Audio and Electroacoustics. Vol. 15, No. 2, June 1967, pp. 70–73.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2015a