MATLAB: Time Delay of Arrival of two acoustic signals from an array using Phased Toolbox

hydrophonePhased Array System Toolbox

I have been trying to simulate a an acoustic sonar system to locate a stationary underwater acoustic beacon using an array of two hydrophones. I've been trying to simulate everything using the Phased Array Toolbox. My main problem is obtaining the time delay of arrival of the signal from the two elements. The angle determination is defined by a formula I have that uses the hydrophone spacing, time delay and speed of sound. All I'm missing is the time delay. This is what I have from the code so far: _____________________________________________________________________________________________________________________
% Create a 2-element array receiver ULA.
N = 2;
hydrophoneSpacing = 0.45; % 18cm(0.45m)
hydrophone = phased.IsotropicHydrophone('VoltageSensitivity',-150);
array = phased.ULA('Element',hydrophone,...
'NumElements',N, 'ElementSpacing',hydrophoneSpacing);
Specify the position and velocity of the sensor array.
ArrayPos = [0; 0; 0]; % Origin position
rxvel1 = [0;0;0];
Specify the signal source position.
SRCpos = [4; 5; 0]; % This can be changed
srcvel = [0;0;0];
%%Define Waveform
% Choose the source signal to be a wideband LFM waveform. Assume the
% operating frequency of the system is 300 kHz and set the bandwidth of the
% signal to 100 kHz. Assume a maximum operating range of 150 m. Then, you
% can set the pulse repetition interval (PRI) and the pulse repetition
% frequency (PRF). Assume a 10% duty cycle and set the pulse width.
% Finally, use a speed of sound in an underwater channel of 1500 m/s.
% This is taken from an example.
Set the LFM waveform parameters and create the phased.LinearFMWaveform System object™.
fc = 300e3; % 300 kHz
c = 1500; % 1500 m/s
dmax = 150; % 150 m
pri = (2*dmax)/c;
prf = 1/pri;
bw = 100.0e3; % 100 kHz
fs = 2*bw;
waveform = phased.LinearFMWaveform('SampleRate',fs,'SweepBandwidth',bw,...
'PRF',prf,'PulseWidth',pri/10);
The transmit signal can then be generated as
signal = waveform();
%%Radiate, Propagate, and Collect Signals
% Modeling the radiation and propagation for wideband systems is more
% complicate than modeling narrowband systems. For example, the attenuation
% depends on frequency. The Doppler shift as well as the phase shifts among
% elements due to the signal incoming direction also vary according to the
% frequency. Thus, it is critical to model those behaviors when dealing
% with wideband signals. This example uses a subband approach.
Set the number of subbands to 128.
nfft = 128;
Specify the source radiator and the sensor array collectors.
radiator = phased.WidebandRadiator('Sensor',hydrophone,...
'PropagationSpeed',c,'SampleRate',fs,...
'CarrierFrequency',fc,'NumSubbands',nfft);
collector1 = phased.WidebandCollector('Sensor',array,...
'PropagationSpeed',c,'SampleRate',fs,...
'CarrierFrequency',fc,'NumSubbands',nfft);
Create the wideband signal propagators for the paths from the source to the two sensor arrays.
channel1 = phased.WidebandFreeSpace('PropagationSpeed',c,...
'SampleRate',fs,'OperatingFrequency',fc,'NumSubbands',nfft);
Determine the propagation directions from the source to the sensor arrays. Propagation directions are with respect to the local coordinate system of the source.
[~,ang1t] = rangeangle(ArrayPos,SRCpos);
Radiate the signal from the source in the directions of the sensor arrays.
sigt = radiator(signal,ang1t);
Then, propagate the signal to the sensor arrays.
sigp1 = channel1(sigt(:,1),SRCpos,ArrayPos,srcvel,rxvel1);
Compute the arrival directions of the propagated signal at the sensor arrays. Because the collector response is a function of the directions of arrival in the sensor array local coordinate system, pass the local coordinate axes matrices to the rangeangle function.
[~,ang1r] = rangeangle(SRCpos,ArrayPos);
Collect the signal at the receive sensor arrays.
sigr1 = collector1(sigp1,ang1r);
%%Lag Estimation
% Element signal delay.
lag = phased.ElementDelay('SensorArray',array,...
'PropagationSpeed',c);
Estimate time delay.
D = lag(sigr1)
_____________________________________________________________________________________________________________________
The method I want to implement uses calculation, such as cross-correlation of two signals to obtain the time delay of the two signals that goes through the channel of the hydrophones. How can I get this time delay from the function that collects the signal such as
phased.WidebandCollector or phased.Collector
There also an example using the function phased.ULA to get the time delay but this doesn't simulate the actual signal been propagated and collected through the underwater channel. Maybe I'm missing a defined function from the toolbox that does this. Any help will be appreciated.
Thanks!

Best Answer

The default frqeuency range for the hydrophone is between 0 and 200 kHz. However, in your example, the carrier is set at 300 kHz, so the response is not correctly generated. If you replace the hydrophone definition as
hydrophone = phased.IsotropicHydrophone('VoltageSensitivity',-150,'FrequencyRange',[0 1e6]);
Then it works fine.
HTH