主要内容

phased.CovarianceEstimator

R2026b

Estimate sample covariance matrix

Since R2026b

Description

The phased.CovarianceEstimator System object™ creates a maximum-likelihood estimator of the sample covariance matrix (SCM). The sample covariance matrix is derived from statistically independent and identically distributed (i.i.d.) data snapshots of complex Gaussian random vectors. You can use the SCM in array processing algorithms such as direction of arrival estimation, beamforming, adaptive coherence estimation, and space-time adaptive processing, because of its simplicity and statistical efficiency. The algorithm always assumes sufficient training data is available.

To estimate the sample covariance matrix of vector:

  1. Create the phased.CovarianceEstimator object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

estimator = phased.CovarianceEstimator creates a phased.CovarianceEstimator System object with default property values.

estimator = phased.CovarianceEstimator(Name=Value) creates a phased.CovarianceEstimator System object with each property Name set to a specified Value. You can specify additional name-value arguments in any order as (Name1=Value1,...,NameN=ValueN).

Example: estimator = phased.CovarianceEstimator(Mode="Update",Method="SCM").

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Method used to estimate the covariance matrix, specified as "SCM" or "NSCM".

  • Use "SCM" to specify the sample covariance matrix.

  • Use "NSCM" to specify the normalized sample covariance matrix.

Example: "NSCM"

Data Types: char | string

Specify the diagonal loading applied to the covariance matrix to improve numeric stability and robustness. Specify the value as a nonnegative scalar, "Input port", or "Shrinkage".

  • Setting the DiagonalLoading property to a nonnegative scalar adds its value to the diagonal elements of the covariance matrix.

  • Setting the DiagonalLoading property to "Input port" uses the input argument epsilon to set the diagonal loading property.

  • Setting the DiagonalLoading property to "Shrinkage" uses a shrinkage-based method to set the diagonal loading property.

Example: DiagonalLoading = "Shrinkage"

Data Types: single | double | char | string

Estimation mode used to create or modify the covariance matrix, specified as "Batch", "Update", or "Update and downdate".

  • Set this property to "Batch" to estimate the covariance matrix solely from current data snapshots xadd.

  • Set this property to "Update" to update the existing covariance matrix from current data snapshots, xadd, and any previous stored covariance matrix.

  • Set this property to "Update and downdate" to update the existing covariance matrix from current data snapshots, xadd, and remove any contributions of the snapshots in xrem.

Example: Mode="Update and downdate"

Data Types: char | string

Usage

Description

covmat = estimator(xadd) estimates the covariance matrix, covmat, from the input snapshots xadd. In this syntax, you can use the object function in either Batch mode or Update mode.

  • If you set the Mode property to "Batch" or leave it unspecified, the object operates in Batch mode and computes the covariance from xadd.

  • If you set the Mode property to "Update", the object updates the current covariance estimate using the snapshots xadd.

example

covmat = estimator(xadd,xrem) updates the covariance matrix by adding the snapshots in xadd and removing the snapshots in xrem. To use this syntax, set the Mode property to "Update and downdate". You can use an empty value [] matrix for xadd or for xrem to indicate that the object applies no updates or downdate using these arguments.

example

covmat = estimator(___,epsilon) also applies the diagonal loading factor epsilon. To enable this syntax, set the DiagonalLoading property to "Input port".

Input Arguments

expand all

Input snapshots, specified as a Qadd-by-N complex-valued matrix. Each of the Qadd rows represents a single snapshot and each snapshot is an N-dimensional vector. The number of columns in xadd, N, must equal the number of columns in xrem.

Complex Number Support: Yes

Snapshots to be removed, specified as a Qrem-by-N complex-valued matrix. Each row of Qrem represents a single snapshot and each snapshot is an N-dimensional vector. The number of columns in xrem, N, must equal the number of columns in xadd.

Dependencies

To enable this argument, set the Mode property to "Update and downdate".

Complex Number Support: Yes

Diagonal loading factor, specified as a nonnegative scalar.

Dependencies

To enable this argument, set the DiagonalLoading property to "Input port".

Output Arguments

expand all

Estimated covariance matrix, returned as an N-by-N Hermitian matrix.

Complex Number Support: Yes

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Theoretical and Empirical Covariance of Received Signal

Simulate receiving a signal at a 2-by-2 uniform rectangular array (URA). The elements are spaced 1/4-wavelength apart. Specify the four corners of the array.

pos = 0.25*[0 0 0 0; -1 1 -1 1; -1 -1 1 1]
pos = 3×4

         0         0         0         0
   -0.2500    0.2500   -0.2500    0.2500
   -0.2500   -0.2500    0.2500    0.2500

Define the noise power independently for each of the four array elements. Each entry in ncov is the noise power of an array element. This element position is the corresponding column in pos. Assume the noise is uncorrelated across elements.

ncov = db2pow([-9 -10 -10 -11]);

Simulate 100 snapshots of the received signal at the array, and store the theoretical and empirical covariance matrices. Assume that one incoming signal originates from 30° azimuth and 10° elevation. A second incoming signal originates from 50° azimuth and 0° elevation. The signals have a power of 1 W and are uncorrelated.

nsamp = 100;
arrival_ang1 = [30;10];
arrival_ang2 = [50;0];
angs = [arrival_ang1,arrival_ang2];
rng default

Covariance matrix from sensorsig

[x,rt,cov] = sensorsig(pos,nsamp,angs,ncov);
disp(cov)
   2.2107 + 0.0000i  -0.7342 - 1.6392i   1.9447 - 0.5481i  -1.2582 - 1.5304i
  -0.7342 + 1.6392i   1.9858 + 0.0000i  -0.2426 + 1.4967i   1.7761 - 0.4745i
   1.9447 + 0.5481i  -0.2426 - 1.4967i   2.1762 + 0.0000i  -0.7315 - 1.6525i
  -1.2582 + 1.5304i   1.7761 + 0.4745i  -0.7315 + 1.6525i   2.0000 + 0.0000i

Sample covariance matrix from phased.CovarianceEstimator

covest = phased.CovarianceEstimator;
disp(covest(x))
   2.2107 + 0.0000i  -0.7342 - 1.6392i   1.9447 - 0.5481i  -1.2582 - 1.5304i
  -0.7342 + 1.6392i   1.9858 + 0.0000i  -0.2426 + 1.4967i   1.7761 - 0.4745i
   1.9447 + 0.5481i  -0.2426 - 1.4967i   2.1762 + 0.0000i  -0.7315 - 1.6525i
  -1.2582 + 1.5304i   1.7761 + 0.4745i  -0.7315 + 1.6525i   2.0000 + 0.0000i

The two covariance matrices agree.

Create pink noise and display its covariance matrix.

Configure a dsp.ColoredNoise System object™ to create complex pink noise.

N = 500;
P = 1e4;
color = "pink";
pinkNoiseGen = dsp.ColoredNoise(Color=color, ...
    SamplesPerFrame=N,NumChannels=P);
sig = pinkNoiseGen() + 1i*pinkNoiseGen();

Display the original covariance matrix.

covest = phased.CovarianceEstimator(Mode="Update and downdate", ...
    DiagonalLoading="Input port");

Set the diagonal loading factor to 0.1.

dlf = 0.1;
covMatrix = covest(sig.',[],dlf);
imagesc(abs(covMatrix))
colorbar
title("Estimated Original ", ...
    "Covariance Matrix Magnitude")

Figure contains an axes object. The axes object with title Estimated Original contains an object of type image.

Apply whitening to the signal

w = whiteningmat(covMatrix);
sigwhite = w*sig;

Display the whitened covariance matrix.

covMatrixWhiten = covest(sigwhite.',[],dlf);
imagesc(abs(covMatrixWhiten))
colorbar
title("Estimated Whitened Covariance", ...
    "Matrix Magnitude")

Figure contains an axes object. The axes object with title Estimated Whitened Covariance contains an object of type image.

More About

expand all

References

[1] Gini, Fulvio, and Maria Greco. “Covariance Matrix Estimation for CFAR Detection in Correlated Heavy Tailed Clutter.” Signal Processing, vol. 82, no. 12, Dec. 2002, pp. 1847–59.

[2] Pascal, F., et al. “Performance Analysis of Covariance Matrix Estimates in Impulsive Noise.” IEEE Transactions on Signal Processing, vol. 56, no. 6, June 2008, pp. 2206–17.

[3] De Maio, Antonio, and Maria Sabrina Greco, editors. Modern Radar Detection Theory. Institution of Engineering and Technology, 2015.

Extended Capabilities

expand all

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

GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.

Version History

Introduced in R2026b