x = sensorsig(pos,ns,ang) simulates
the received narrowband plane wave signals at a sensor array. pos represents
the positions of the array elements, each of which is assumed to be
isotropic. ns indicates the number of snapshots
of the simulated signal. ang represents the incoming
directions of each plane wave signal. The plane wave signals are assumed
to be constant-modulus signals with random phases.

x = sensorsig(pos,ns,ang,ncov) describes
the noise across all sensor elements. ncov specifies
the noise power or covariance matrix. The noise is a Gaussian distributed
signal.

x = sensorsig(pos,ns,ang,ncov,scov) specifies
the power or covariance matrix for the incoming signals.

[x,rt] =
sensorsig(___) also returns the theoretical
covariance matrix of the received signal, using any of the input arguments
in the previous syntaxes.

Simulate the received signal at an array, and use the data to estimate the arrival directions.

Create an 8-element uniform linear array whose elements are spaced half a wavelength apart.

fc = 3e8;
c = 3e8;
lambda = c/fc;
ha = phased.ULA(8,lambda/2);

Simulate 100 snapshots of the received signal at the array. Assume there are two signals, coming from azimuth 30 and 60 degrees, respectively. The noise is white across all array elements, and the SNR is 10 dB.

x = sensorsig(getElementPosition(ha)/lambda,...
100,[30 60],db2pow(-10));

Use a beamscan spatial spectrum estimator to estimate the arrival directions, based on the simulated data.

Simulate receiving two uncorrelated incoming signals that have different power levels. A vector named scov stores the power levels.

Create an 8-element uniform linear array whose elements are spaced half a wavelength apart.

fc = 3e8;
c = 3e8;
lambda = c/fc;
ha = phased.ULA(8,lambda/2);

Simulate 100 snapshots of the received signal at the array. Assume that one incoming signal originates from 30 degrees azimuth and has a power of 3 W. A second incoming signal originates from 60 degrees azimuth and has a power of 1 W. The two signals are not correlated with each other. The noise is white across all array elements, and the SNR is 10 dB.

ang = [30 60];
scov = [3 1];
x = sensorsig(getElementPosition(ha)/lambda,...
100,ang,db2pow(-10),scov);

Use a beamscan spatial spectrum estimator to estimate the arrival directions, based on the simulated data.

Simulate the reception of three signals, two
of which are correlated. A matrix named scov stores
the signal covariance matrix.

Create a signal covariance matrix in which the first and
third of three signals are correlated with each other.

scov = [1 0 0.6;...
0 2 0 ;...
0.6 0 1 ];

Simulate receiving 100 snapshots of three incoming signals
from 30, 40, and 60 degrees azimuth, respectively. The array that
receives the signals is an 8-element uniform linear array whose elements
are spaced half a wavelength apart. The noise is white across all
array elements, and the SNR is 10 dB.

pos = (0:7)*0.5;
ns = 100;
ang = [30 40 60];
ncov = db2pow(-10);
x = sensorsig(pos,ns,ang,ncov,scov);

Simulate receiving a signal at a URA. Compare
the signal's theoretical covariance, rt,
with its sample covariance, r.

Create a 2-by-2 uniform rectangular array whose elements
are spaced 1/4 of a wavelength apart.

pos = 0.25 * [0 0 0 0; -1 1 -1 1; -1 -1 1 1];

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's 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 degrees azimuth and 10
degrees elevation. A second incoming signal originates from 50 degrees
azimuth and 0 degrees elevation. The signals have a power of 1 W and
are not correlated with each other.

Simulate receiving a signal at a ULA, where
the noise among different sensors is correlated.

Create a 4-element uniform linear array whose elements
are spaced half a wavelength apart.

pos = 0.5 * (0:3);

Define the noise covariance matrix. The value in the (k, j)
position in the ncov matrix is the covariance between
the kth and jth array elements
listed in pos.

Positions of elements in sensor array, specified as an N-column
vector or matrix. The values in the matrix are in units of signal
wavelength. For example, [0 1 2] describes three
elements that are spaced one signal wavelength apart. N is the number
of elements in the array.

Dimensions of pos:

For a linear array along the y axis, specify the y
coordinates of the elements in a 1-by-N vector.

For a planar array in the yz plane, specify the y
and z coordinates of the elements in columns of a 2-by-N matrix.

For an array of arbitrary shape, specify the x, y,
and z coordinates of the elements in columns of a 3-by-N matrix.

Directions of incoming plane wave signals, specified as an M-column
vector or matrix in degrees. M is the number of incoming signals.

Dimensions of ang:

If ang is a 2-by-M matrix, each
column specifies a direction. Each column is in the form [azimuth;
elevation]. The azimuth angle must be
between –180 and 180 degrees, inclusive. The elevation angle
must be between –90 and 90 degrees, inclusive.

If ang is a 1-by-M vector, each
entry specifies an azimuth angle. In this case, the corresponding
elevation angle is assumed to be 0.

Noise characteristics, specified as a nonnegative scalar, 1-by-N
vector of positive numbers, or N-by-N positive definite matrix.

Dimensions of ncov:

If ncov is a scalar, it represents
the noise power of the white noise across all receiving sensor elements,
in watts. In particular, a value of 0 indicates
that there is no noise.

If ncov is a 1-by-N vector, each
entry represents the noise power of one of the sensor elements, in
watts. The noise is uncorrelated across sensors.

If ncov is an N-by-N matrix,
it represents the covariance matrix for the noise across all sensor
elements.

Incoming signal characteristics, specified as a positive scalar,
1-by-M vector of positive numbers, or M-by-M positive semidefinite
matrix.

Dimensions of scov:

If scov is a scalar, it represents
the power of all incoming signals, in watts. In this case, all incoming
signals are uncorrelated and share the same power level.

If scov is a 1-by-M vector, each
entry represents the power of one of the incoming signals, in watts.
In this case, all incoming signals are uncorrelated with each other.

If scov is an M-by-M matrix,
it represents the covariance matrix for all incoming signals. The
matrix describes the correlation among the incoming signals. In this
case, scov can be real or complex.

Received signal at sensor array, returned as a complex ns-by-N
matrix. Each column represents the received signal at the corresponding
element of the array. Each row represents a snapshot.

Sample covariance matrix of the received signal, returned as
a complex N-by-N matrix. N is the number of array elements. The function
derives this matrix from x.

Note:
If you specify this output argument, consider making ns greater
than or equal to N. Otherwise, r is rank deficient.

The azimuth angle is
the angle from the positive x-axis toward the positive y-axis,
to the vector's orthogonal projection onto the xy plane.
The azimuth angle is between –180 and 180 degrees. The elevation
angle is the angle from the vector's orthogonal
projection onto the xy plane toward the positive z-axis,
to the vector. The elevation angle is between –90 and 90 degrees.
These definitions assume the boresight direction is the positive x-axis.

Note:
The elevation angle is sometimes defined in the literature as
the angle a vector makes with the positive z-axis.
The MATLAB^{®} and Phased Array System Toolbox™ products do not
use this definition.

This figure illustrates the azimuth angle and elevation angle
for a vector that appears as a green solid line. The coordinate system
is relative to the center of a uniform linear array, whose elements
appear as blue circles.