xcov = sensorcov(pos,ang) returns
the sensor spatial covariance matrix, xcov, for
narrowband plane wave signals arriving at a sensor array. The sensor
array is defined by the sensor positions specified in the pos argument.
The signal arrival directions are specified by azimuth and elevation
angles in the ang argument. In this syntax, the
noise power is assumed to be zero at all sensors, and the signal power
is assumed to be unity for all signals.

xcov = sensorcov(pos,ang,ncov) specifies,
in addition, the spatial noise covariance matrix, ncov.
This value represents the noise power on each sensor as well as the
correlation of the noise between sensors. In this syntax, the signal
power is assumed to be unity for all signals. This syntax can use
any of the input arguments in the previous syntax.

xcov = sensorcov(pos,ang,ncov,scov) specifies,
in addition, the signal covariance matrix, scov,
which represents the power in each signal and the correlation between
signals. This syntax can use any of the input arguments in the previous
syntaxes.

Create a covariance matrix for a 3-element,
half-wavelength-spaced line array. Use the default syntax, which assumes
no noise power and unit signal power.

N = 3; % Elements in array
d = 0.5; % sensor spacing half wavelength
elementPos = (0:N-1)*d;
xcov = sensorcov(elementPos,[30 60]);

Create a spatial covariance matrix for a 3-element,
half-wavelength-spaced line array. Assume there are two incoming unit-power
signals and there is a noise value of –10 dB. By default, scov is
the identity matrix.

N = 3; % Elements in array
d = 0.5; % sensor spacing half wavelength
elementPos = (0:N-1)*d;
xcov = sensorcov(elementPos,[30 35],db2pow(-10));

Compute the covariance matrix for a 3-element
half-wavelength spaced line array when there is some correlation between
two signals. The correlation can model, for example, multipath propagation
caused by reflection from a surface. Assume a noise power value of
–10 dB.

N = 3; % Elements in array
d = 0.5; % sensor spacing half wavelength
elementPos = (0:N-1)*d;
scov = [1, 0.8; 0.8, 1];
xcov = sensorcov(elementPos,[30 35],db2pow(-10),scov);

Positions of the elements of a sensor array specified as a 1-by-N vector,
a 2-by-N matrix, or a 3-by-N matrix.
In this vector or matrix, N represents the number
of elements of the array. Each column of pos represents
the coordinates of an element. You define sensor position units in
term of signal wavelength. If pos is a 1-by-N vector,
then it represents the y-coordinate of the sensor
elements of a line array. The x and z-coordinates
are assumed to be zero. If pos is a 2-by-N matrix,
then it represents the (y,z)-coordinates of the
sensor elements of a planar array which is assumed to lie in the yz-plane.
The x-coordinates are assumed to be zero. If pos is
a 3-by-N matrix, then the array has arbitrary shape.

Arrival directions of incoming signals specified as a 1-by-M vector
or a 2-by-M matrix, where M is
the number of incoming signals. If ang is a 2-by-M matrix,
each column specifies the direction in azimuth and elevation of the
incoming signal [az;el]. Angular units are specified
in degrees. The azimuth angle must lie between –180° and
180° and the elevation angle must lie between –90°
and 90°. The azimuth angle is the angle between the x-axis
and the projection of the arrival direction vector onto the xy plane.
It is positive when measured from the x-axis toward
the y-axis. The elevation angle is the angle between
the arrival direction vector and xy-plane. It is
positive when measured towards the z axis. If ang is
a 1-by-M vector, then it represents a set of azimuth
angles with the elevation angles assumed to be zero.

Noise spatial covariance matrix specified as a non-negative,
real-valued scalar, a non-negative, 1-by-N real-valued
vector or an N-by-N, positive
definite, complex-valued matrix. In this argument, N is
the number of sensor elements. Using a non-negative scalar results
in a noise spatial covariance matrix that has identical white noise
power values (in watts) along its diagonal and has off-diagonal values
of zero. Using a non-negative real-valued vector results in a noise
spatial covariance that has diagonal values corresponding to the entries
in ncov and has off-diagonal entries of zero.
The diagonal entries represent the independent white noise power values
(in watts) in each sensor. If ncov is N-by-N matrix,
this value represents the full noise spatial covariance matrix between
all sensor elements.

Signal covariance matrix specified as a non-negative, real-valued
scalar, a 1-by-M non-negative,
real-valued vector or an M-by-M positive
semidefinite, matrix representing the covariance matrix between M signals.
The number of signals is specified in ang. If scov is
a nonnegative scalar, it assigns the same power (in watts) to all
incoming signals which are assumed to be uncorrelated. If scov is
a 1-by-M vector, it assigns the separate power
values (in watts) to each incoming signal which are also assumed to
be uncorrelated. If scov is an M-by-M matrix,
then it represents the full covariance matrix between all incoming
signals.