Main Content

step

System object: phased.GCCEstimator
Namespace: phased

Estimate direction of arrival using generalized cross-correlation

Description

Note

Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

ang = step(sGCC,X) returns the direction of arrival, ang, of an input signal X. The argument X is a matrix specifying the received signals at the elements of the array specified in the SensorArray property. Signals propagate from a single source. Each column in X corresponds to the elements in the array (if an array is used) or the number of subarrays (if a subarray is used). Each row of X represents a single time snapshot.

[ang,tau] = step(sGCC,X) returns the time delays, tau, estimated from the correlations between pairs of sensors. To use this syntax, set the DelayOutputPort property to true. The argument tau is a P-element row vector, where P is the number of sensor pairs, and where P = N(N-1).

[ang,R,lag] = step(sGCC,X) returns the estimated correlations, R, between pairs of sensors, when you set the CorrelationOutputPort property to true. R is a matrix with P columns where P is the number of sensor pairs. Each column in R contains the correlation for the corresponding pair of sensors. lag is a column vector containing the time lags corresponding to the rows of the correlation matrix. The time lags are the same for all sensor pairs.

example

You can combine optional input arguments when their enabling properties are set. Optional inputs must be listed in the same order as their enabling properties. For example,[ang,tau,R,lag] = step(sGCC,X) is valid when you set both DelayOutputPort and CorrelationOutputPort to true.

Note

The object performs an initialization the first time the object is executed. This initialization locks nontunable properties and input specifications, such as dimensions, complexity, and data type of the input data. If you change a nontunable property or an input specification, the System object issues an error. To change nontunable properties or inputs, you must first call the release method to unlock the object.

Input Arguments

expand all

GCC-PHAT estimator, specified as a phased.GCCEstimator System object.

Example: phased.GCCEstimator

Received signal, specified as an M-by-N complex-valued matrix. The quantity M is the number of sample values (snapshots) of the signal and N is the number of sensor elements in the array. For subarrays, N is the number of subarrays.

The size of the first dimension of the input matrix can vary to simulate a changing signal length. A size change can occur, for example, in the case of a pulse waveform with variable pulse repetition frequency.

Example: [[0;1;2;3;4;3;2;1;0],[1;2;3;4;3;2;1;0;0]]

Data Types: single | double
Complex Number Support: Yes

Output Arguments

expand all

Direction of arrival of a signal, returned as a 2-by-1 real-valued column vector in the form [azimuth;elevation]. If the array is a uniform linear array, ang is a scalar representing the broadside angle. Angle units are in degrees, defined with respect to the local coordinate system of the array.

Time delays of arrival, returned as 1-by-P real-valued row vector. P is the number of sensor pairs selected from the array.

  • When SensorPairSource is set to 'Auto', P = N - 1. N is the number of elements in the array.

  • When SensorPairSource is set to 'Property', P is the number of sensor pairs specified by the SensorPair property.

Time units are seconds. This output is enabled when you set the DelayOutputPort property to true.

Estimated cross-correlation between pairs of sensors, returned as a (2M+1)-by-P complex-valued matrix, where P is the number of sensor pairs selected from the array.

  • When SensorPairSource is set to 'Auto', P = N - 1. N is the number of elements in the array. The columns in R contain the correlations between the first sensor and all other sensors.

  • When SensorPairSource is set to 'Property', P is the number of sensor pairs specified by the SensorPair property. Each column in R contains the correlation for the corresponding pair of sensors.

M is the number of time samples in the input signal. This output is enabled when you set the CorrelationOutputPort property to true.

Time lags, returned as an (2M+1)-by-1 real-valued column vector. M is the number of time samples in the input signal. Each time lag applies to the corresponding row in the cross-correlation matrix.

Examples

expand all

Estimate the direction of arrival of a signal using GCC-PHAT. The receiving array is a 5-by-5-element URA microphone array with elements spaced 25 centimeters apart. Choose 10 element pairs to compute the arrival angle. Assume the speed of sound in air is 340 meters/second. The arriving signal is a sequence of wideband sounds. Assume the signal arrives from 54 degrees azimuth and five degrees elevation. Estimate the arrival angle, and then plot the correlation function versus lag for a pair of elements.

Load the signal and extract a small portion for computation.

load gong;
y1 = y(1:100);

Set up the receiving array.

N = 5;
d = 0.25;
sMic = phased.OmnidirectionalMicrophoneElement;
sURA = phased.URA([N,N],[d,d],'Element',sMic);

Simulate the arriving plane wave using the WidebandCollector System object™.

c = 340.0;
arrivalAng = [54;5];
sWBC = phased.WidebandCollector('Sensor',sURA,...
    'PropagationSpeed',c,...
    'SampleRate',Fs,...
    'ModulatedInput',false);
signal = step(sWBC,y1,arrivalAng);

Estimate direction of arrival. Choose 10 sensors to correlate with the first element of the URA.

sensorpairs = [[2,4,6,8,10,12,14,16,18,20];ones(1,10)];
sGCC = phased.GCCEstimator('SensorArray',sURA,...
    'PropagationSpeed',c,'SampleRate',Fs,...
    'SensorPairSource','Property',...
    'SensorPair',sensorpairs,...
    'DelayOutputPort',true','CorrelationOutputPort',true);
[estimatedAng,taus,R,lags] = step(sGCC,signal);

The estimated angle is:

disp(estimatedAng)
   11.6720
    4.2189

Plot the correlation between sensor 8 and sensor 1. This pair corresponds to the fourth column of the correlation matrix. The estimated value of tau (in milliseconds) for this pair is:

disp(1000*taus(4))
    0.0238
plot(1000*lags,real(R(:,4)))
xlabel('Time lags (msec)')
ylabel('Correlation')

Algorithms

expand all

References

[1] Charles H. Knapp and Carter, G.C., The Generalized Correlation Method for Estimation of Time Delay, IEEE Transactions on Acoustics, Speech and Signal Processing, Vol, ASSP-24, No. 4. August 1976.

[2] G. Clifford Carter Coherence and Time Delay Estimation, Proceedings of the IEEE, vol 75, No 2, Feb 1987.

Version History

Introduced in R2015b