Channel replay

Quickstart guide

The idea of channel replay was popularized in the underwater domain by the Watermark benchmark. The essential idea is to extract estimates of time-varying impulse response (TVIR) from measurements at sea, and to convolve it with a new signals to estimate what would have been received had that signal been transmitted during the measurement.

Loading a replay channel

To do channel replay using UnderwaterAcoustics.jl, we build a AbstractAcousticChannel from the measured TVIR using the BasebandReplayChannel() constructor. It can either take in a TVIR as a matrix or load a TVIR from file (e.g. red.mat):

using UnderwaterAcoustics
using Plots

ch = BasebandReplayChannel("red.mat")
BasebandReplayChannel(4 × 48.6 s, 25000.0 Hz, 19200.0 Sa/s)

This channel has 4 receiving hydrophones and can replay up to 48.6 seconds of signal through the measured TVIR. The signal must fit within the frequency band that was used to probe the channel (for the red channel it is 25 ± 4.8 kHz).

We can visualize the TVIR for the first hydrophone by plotting it:

plot(ch)

If we were interested in the second hydrophone, we could specify the hydrophone number to plot:

plot(ch, 2)

Simulating a transmission

To pass a signal through the channel, we generate a signal and transmit() it just like through any other AbstractAcousticChannel:

using SignalAnalysis

x = cw(25000, 0.001, 192000; window=(tukey, 0.5)) |> real
y = transmit(ch, x; start=1)
SampledSignal @ 192000.0 Hz, 2390×4 Matrix{Float64}:
 -2.30613e-7  -1.68895e-6   -1.1229e-6    -2.03047e-7
 -4.25422e-6  -8.90027e-6    7.01078e-6    4.48666e-6
 -1.3377e-5    3.60596e-6    4.19679e-5    1.89721e-5
 -1.33863e-5   4.80151e-5    7.71856e-5    3.04576e-5
  5.81851e-6   9.91395e-5    5.37547e-5    7.95031e-6
  3.28637e-5   9.13493e-5   -7.00844e-5   -6.70238e-5
  1.7783e-5   -1.71968e-6   -0.00025141   -0.000218488
 -1.15864e-5  -0.000246922  -0.00037416   -0.00021522
 -5.00586e-5  -0.000406431  -0.000210164  -9.42333e-6
 -5.92106e-5  -0.000274687   0.000252787   0.000308203
  ⋮                                       
 -1.35041e-6   2.11438e-6   -7.64514e-7    1.84144e-6
 -6.89779e-6   9.27182e-6    4.12781e-6   -5.57121e-6
  5.73854e-6   1.94118e-5   -1.08619e-5   -3.94149e-6
  1.91871e-5   1.50366e-5   -2.28804e-5    3.53182e-6
  1.85164e-5  -1.02922e-6   -1.77299e-5    8.50609e-6
 -8.58834e-6  -7.36296e-6    2.74406e-6    3.37492e-6
 -1.52027e-5  -1.24997e-5    1.74962e-5   -8.65891e-6
 -9.08902e-6  -7.5428e-6     1.41824e-5   -9.43826e-6
 -1.10549e-6  -1.07817e-6    3.7533e-6    -3.39312e-6

We have 4 channels of received data since we have 4 hydrophones in the replay TVIR. We plot the transmitted signal and the first 5 ms of the replayed received signal (hydrophone 2):

plot(
  plot(x; xlims=(0,5)),
  plot(y[:,2]; xlims=(0,5));
  layout=(2,1)
)

Adding noise

We can also simulate channels with noise. For example, if we wanted white Gaussian noise with standard deviation σ = 0.1, we can specify that when loading the channel:

ch = BasebandReplayChannel("red.mat"; noise=WhiteGaussianNoise(0.1))
y = transmit(ch, x; start=1)

plot(
  plot(x; xlims=(0,5)),
  plot(y[:,2]; xlims=(0,5));
  layout=(2,1)
)