# mdltest

Dimension of signal subspace

## Description

estimates
the number of signals, `nsig`

= mdltest(`X`

)`nsig`

, present in a *snapshot* of
data, `X`

, that impinges upon the sensors in an
array. The estimator uses the *Minimum Description Length * (MDL)
test. The input argument, `X`

, is a complex-valued
matrix containing a time sequence of data samples for each sensor.
Each row corresponds to a single time sample for all sensors.

## Examples

### Estimate the Signal Subspace Dimensions for Two Arriving Signals

Construct a data snapshot of two plane waves arriving at a half-wavelength-spaced uniform line array having 10 elements. The plane waves arrive from 0° and –25° azimuth, both with elevation angles of 0°. Assume the signals arrive in the presence of additive noise that is both temporally and spatially Gaussian white. For each signal, the SNR is 5 dB. Take 300 samples to build a 300-by-10 data snapshot. Then, solve for the number of signals using `mdltest`

.

N = 10; d = 0.5; elementPos = (0:N-1)*d; angles = [0 -25]; x = sensorsig(elementPos,300,angles,db2pow(-5)); Nsig = mdltest(x)

Nsig = 2

The result shows that the number of signals is two, as expected.

### Estimate the Signal Subspace Dimensions Using Forward-Backward Averaging

Construct a data snapshot for two plane waves arriving at a half-wavelength-spaced uniform line array with 10 elements. Correlated plane waves arrive from 0° and 10° azimuth, both with elevation angles of 0°. Assume the signals arrive in the presence of additive noise that is both temporally and spatially Gaussian white noise. For each signal, the SNR is 10 dB. Take 300 samples to build a 300-by-10 data snapshot. Then, solve for the number of signals using `mdltest`

.

N = 10; d = 0.5; elementPos = (0:N-1)*d; angles = [0 10]; ncov = db2pow(-10); scov = [1 .5]'*[1 .5]; x = sensorsig(elementPos,300,angles,ncov,scov); Nsig = mdltest(x)

Nsig = 1

This result shows that `mdltest`

cannot determine the number of signals correctly when the signals are correlated.

Now, try the forward-backward smoothing option.

`Nsig = mdltest(x,'fb')`

Nsig = 2

The addition of forward-backward smoothing yields the correct number of signals.

## Input Arguments

`X`

— Data snapshot

complex-valued *K*-by-*N* matrix

Data snapshot, specified as a complex-valued, *K*-by-*N* matrix.
A snapshot is a sequence of time-samples taken simultaneous at each
sensor. In this matrix, *K* represents the number
of time samples of the data, while *N* represents
the number of sensor elements.

**Example: ** [ –0.1211 + 1.2549i, 0.1415 + 1.6114i, 0.8932
+ 0.9765i; ]

**Data Types: **`double`

**Complex Number Support: **Yes

## Output Arguments

`nsig`

— Dimension of signal subspace

non-negative integer

Dimension of signal subspace, returned as a non-negative integer. The dimension of the signal subspace is the number of signals in the data.

## More About

### Estimating the Number of Sources

AIC and MDL tests

Direction finding algorithms such as MUSIC and
ESPRIT require knowledge of the number of sources of signals impinging
on the array or equivalently, the dimension, *d*,
of the signal subspace. The Akaike Information Criterion (AIC) and
the Minimum Description Length (MDL) formulas are two frequently-used
estimators for obtaining that dimension. Both estimators assume that,
besides the signals, the data contains spatially and temporally white
Gaussian random noise. Finding the number of sources is equivalent
to finding the multiplicity of the smallest eigenvalues of the sampled
spatial covariance matrix. The sample spatial covariance matrix constructed
from a data snapshot is used in place of the actual covariance matrix.

A requirement for both estimators is that the dimension of the
signal subspace be less than the number of sensors, *N*,
and that the number of time samples in the snapshot, *K*,
be much greater than *N*.

A variant of each estimator exists when forward-backward averaging
is employed to construct the spatial covariance matrix. Forward-backward
averaging is useful for the case when some of the sources are highly
correlated with each other. In that case, the spatial covariance matrix
may be ill conditioned. Forward-backward averaging can only be used
for certain types of symmetric arrays, called *centro-symmetric* arrays.
Then the forward-backward covariance matrix can be constructed from
the sample spatial covariance matrix, *S*, using *S _{FB} =
S + JS*J* where

*J*is the exchange matrix. The exchange matrix maps array elements into their symmetric counterparts. For a line array, it would be the identity matrix flipped from left to right.

All the estimators are based on a cost function

$${L}_{d}(d)=K(N-d)\mathrm{ln}\left\{\frac{\frac{1}{N-d}{\displaystyle \sum _{i=d+1}^{N}{\widehat{\lambda}}_{i}}}{{\left\{{\displaystyle \prod _{i=d+1}^{N}{\widehat{\lambda}}_{i}}\right\}}^{\frac{1}{N-d}}}\right\}$$

plus an added penalty
term. The value λ* _{i}* represent
the smallest

*(N–d)*eigenvalues of the spatial covariance matrix. For each specific estimator, the solution for

*d*is given by

AIC

$${\widehat{d}}_{AIC}=\underset{d}{\mathrm{argmin}}\text{\hspace{0.17em}}\left\{{L}_{d}(d)+d(2N-d)\right\}$$

AIC for forward-backward averaged covariance matrices

$${\widehat{d}}_{AIC:\text{\hspace{0.17em}}FB}=\underset{d}{\mathrm{argmin}}\text{\hspace{0.17em}}\left\{{L}_{d}(d)+\frac{1}{2}d(2N-d+1)\right\}$$

MDL

$${\widehat{d}}_{MDL}=\underset{d}{\mathrm{argmin}}\text{\hspace{0.17em}}\left\{{L}_{d}(d)+\frac{1}{2}(d(2N-d)+1)\mathrm{ln}K\right\}$$

MDL for forward-backward averaged covariance matrices

$${\widehat{d}}_{MDL\text{\hspace{0.17em}}FB}=\underset{d}{\mathrm{argmin}}\text{\hspace{0.17em}}\left\{{L}_{d}(d)+\frac{1}{4}d(2N-d+1)\mathrm{ln}K\right\}$$

## References

[1] Van Trees, H.L. *Optimum Array
Processing*. New York: Wiley-Interscience, 2002.

## Extended Capabilities

### C/C++ Code Generation

Generate C and C++ code using MATLAB® Coder™.

Usage notes and limitations:

Does not support variable-size inputs.

## Version History

**Introduced in R2013a**

## See Also

`aictest`

| `espritdoa`

| `rootmusicdoa`

| `spsmooth`

## Open Example

You have a modified version of this example. Do you want to open this example with your edits?

## MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

# Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)