This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

User's Guide

Instructions for downloading the channel library, replaying a signal through a channel, adding site-specific noise, and visualizing a decompressed channel.

Use the library to pass a signal through a measured underwater channel or to plot how the channel changes over time. The code is available on GitHub.

Installation

matlab.addons.install(websave([tempname '.mltbx'], 'https://github.com/uwa-channels/matlab/releases/latest/download/uwa-channels.mltbx'))
pip install uwa-channels
using Pkg
Pkg.add(url="https://github.com/org-arl/UnderwaterAcoustics.jl")
Pkg.add("MAT")

The MATLAB command installs the latest release as an add-on. The functions replay, noisegen, and unpack will then be available in every session. Run the command again to update the toolbox. To remove it, run matlab.addons.uninstall('Underwater Acoustic Channel Toolbox'), or use Home > Add-Ons > Manage Add-Ons.

Installing the MATLAB source

If you want to read or modify the source, add the repository folders to the search path instead:

git clone https://github.com/uwa-channels/matlab.git
cd matlab

In MATLAB, open the cloned folder and run:

install

This adds src and examples to the search path and saves it for future sessions. Changes to src take effect immediately. If you previously installed the packaged add-on, remove it before using the source installation. Otherwise, MATLAB may run a different copy from the one you are editing.

Requirements

The MATLAB package requires R2021a or later with the Signal Processing Toolbox. Octave is not supported.

The Python package requires Python 3.10 or later; pip installs its dependencies (NumPy, SciPy, Matplotlib, and h5py).

Julia support is provided by the UnderwaterAcoustics.jl package, maintained separately by the Acoustic Research Laboratory, with the MAT package to read the files. It requires Julia 1.9 or later. The released version (v0.8.1) cannot apply phi_hat or f_resamp, which most channels use, so install the development version from GitHub as shown above until the next release. See the replay guide of that package for more detail.

Once a package is installed, download the channel MAT-files from Zenodo and place them where MATLAB or Python can find them. The channel files are distributed separately from the code because of their size. In Julia, a name such as uacr://blue_1 instead of a file path downloads that file from Zenodo and caches it.

Applying a channel to an arbitrary signal

  1. Generate a real passband signal within the chosen channel’s bandwidth and sampling-rate limits. These limits are listed on the Channels pages.
  2. Pass the signal through the channel with replay.
  3. Generate noise with noisegen, scale it to the desired level, and add it to the replay output.

Use the same array_index for replay and noisegen so that the signal and noise correspond to the same array elements. Indices start at 1 in MATLAB and Julia, and at 0 in Python.

The example uses the first three elements of the Blue array and a noise scale of 0.05.

channel = load('blue_1.mat');
noise = load('blue_noise.mat');
array_index = [1, 2, 3];
y = replay(input, fs, array_index, channel);
w = noisegen(size(y), fs, array_index, noise);
r = y + 0.05 * w;
from uwa_channels import replay, noisegen, load_channel, load_noise
channel = load_channel("blue_1.mat")
noise = load_noise("blue_noise.mat")
array_index = [0, 1, 2]
y = replay(input, fs, array_index, channel)
w = noisegen(y.shape, fs, array_index, noise)
r = y + 0.05 * w
using UnderwaterAcoustics, MAT
noise = ReplayNoise("blue_noise.mat"; σ=0.05)
channel = BasebandReplayChannel("blue_1.mat"; rxs=1:3, noise)
r = transmit(channel, input; fs)

Replay duration and starting point

The input is a real passband signal sampled at fs and must be shorter than the channel recording. The output extends beyond the input by approximately the impulse-response duration. Channels with phi_hat also need room for the largest delay drift reached during replay.

Each call to replay starts at a random point in the recording. To choose that point, pass start as the fifth argument. It specifies the starting sample at params.fs_delay and makes the replay repeatable. The output is not normalized: its power depends on the channel.

Loading files and using Julia

In Python, load_channel and load_noise read both the released -v7.3 files and MAT v5 files, and their output can be passed to replay, noisegen, and unpack. In MATLAB, the built-in load reads the files directly.

In Julia, transmit adds the noise itself, scaled by σ, so it returns rout(t)r_{\text{out}}(t) directly, and its start keyword plays the role of start in replay. ReplayNoise is added by UnderwaterAcoustics.jl#95, which is not merged yet; until it is, pass a noise model such as WhiteGaussianNoise(0.05) instead.

For a channel without a site-specific noise model, such as Brown, call noisegen(size(y), fs) in MATLAB or noisegen(y.shape, fs) in Python to generate the generic noise, which is spatially uncorrelated with unit power on every element; in Julia, use PinkGaussianNoise(σ), also added by that pull request.

Noise level

The received signal is

rout(t)=rˉout(t)+σnn^(t),r_{\text{out}}(t) = \bar{r}_{\text{out}}(t) + \sigma_n \hat{n}(t),

where rˉout(t)\bar{r}_{\text{out}}(t) is the noiseless replay output and n^(t)\hat{n}(t) is the generated noise. Adjust σn\sigma_n to set the signal-to-noise ratio. In the example, σn=0.05\sigma_n = 0.05.

Noise is normalized across the full array. The expected powers of all MM elements sum to MM, while their measured relative powers are preserved. Thus σn2\sigma_n^2 is the average noise power per element, and quieter elements have a higher SNR. Selecting a subset with array_index preserves each element’s power; the powers of the selected elements need not sum to the number selected. For Red’s impulsive noise, pseudo-power 2c22c^2 replaces power, where cc is the scale parameter.

Complete examples

The MATLAB example and Python example show the full process. Follow the repository’s README before running them, and put blue_1.mat and blue_noise.mat from Zenodo in the working folder.

Visualizing a channel

Use unpack to reconstruct the impulse response h^(τ,t)\hat{h}(\tau, t), including delay drift, for plotting:

unpack(fs_time, array_index, channel)

The result is a K×M×TK \times M \times T array: KK delay taps, MM selected array elements, and TT time snapshots. Choose the time sampling rate with fs_time; it must be positive and no greater than the delay sampling rate.

By default, unpack adds zero padding equal to 10% of the stored delay length on each side. The reconstructed array is therefore larger than h_hat. Use buffer_left and buffer_right to change the padding.

unpack checks the inputs before reconstruction. It requires channel version 1.0 or later, a nonempty selection of distinct, valid array elements, and nonnegative padding. If f_resamp is present, it must contain one positive factor for the whole array or one per element.

See the MATLAB example or Python example, and follow the setup instructions in the repository’s README.

In Julia, load Plots and use plot(channel) for the first element or plot(channel, i) for element i. UnderwaterAcoustics.jl does not provide unpack.

Citing the library

If you use the channels, the noise models, or the code in your work, please cite the paper that describes the library, arXiv:2609.03207:

@misc{li2026underwater,
  title         = {Underwater Acoustic Channel Library},
  author        = {Li, Zhengnan and Chitre, Mandar and Cuji, Diego A. and Preisig, James and Singer, Andrew C. and Stojanovic, Milica and van Walree, Paul},
  year          = {2026},
  eprint        = {2609.03207},
  archivePrefix = {arXiv},
  primaryClass  = {eess.SP},
  doi           = {10.48550/arXiv.2609.03207},
  url           = {https://arxiv.org/abs/2609.03207}
}

1 - Channel and noise file formats

Specification of the required and optional fields in the channel and noise .mat files, including the impulse response, phase/delay tracking, and metadata formats.

Save channel and noise .mat files with these flags:

  • -v7.3 to support large variables and the HDF5 file format.
  • -nocompression to speed up loading.

The Python loaders load_channel and load_noise also read MAT v5 files, but files you distribute should be saved with -v7.3 -nocompression.

Required fields

Each channel .mat file must include these variables:

h_hat

  • Type: Multi-dimensional complex tensor.

  • Dimensions: [delay, receiver, time]

  • Units:

    • Delay axis: sampled at params.fs_delay [Hz], denoted fs=1/Tsf_s = 1/T_s
    • Time axis: sampled at params.fs_time [Hz]
    • Amplitude: complex baseband impulse response (unitless)
  • Description: The estimated time-varying channel impulse response (TVIR) as a function of delay τ\tau and time tt. When delay tracking is used, this is the drift-free response h‾^(τ,t)\hat{\underline{h}}(\tau, t); otherwise it is the drifting response h^(τ,t)\hat{h}(\tau, t). For a given receiver and time index nn, the slice along the delay axis is the channel vector h‾^[n]\hat{\underline{\mathbf{h}}}[n], or h^[n]\hat{\mathbf{h}}[n] in the drifting case.

  • Normalization: h_hat is scaled so that a passband signal of unit power, in the band the channel was estimated in and replayed through all MM receivers in the file over the full length of the channel, gives output powers that sum to MM. replay does not rescale its output, so h_hat alone sets this power. Each receiver keeps its measured power relative to the others, so a subset selected with array_index need not give a proportional share of MM. A short replay need not give MM either, because it sees only part of the fading.

    The estimate is made at Ns=fs/RN_s = f_s/R samples per symbol, where RR is the symbol rate, so its response is confined to the signal band, a fraction 1/Ns1/N_s of the delay band. The criterion then fixes the energy of the taps. Let h^m[l,n]\hat h_m[l, n] be tap ll of receiver mm at time index nn, with NτN_\tau taps and NtN_t time samples. Averaged over time, the energy summed over all taps and receivers is

    1Nt∑n=0Nt−1∑m=0M−1∑l=0Nτ−1∣h^m[l,n]∣2=MNs\frac{1}{N_t}\sum_{n=0}^{N_t-1}\sum_{m=0}^{M-1}\sum_{l=0}^{N_\tau-1}\left|\hat h_m[l, n]\right|^2 = \frac{M}{N_s}

    meta.nsd stores NsN_s. When it is absent, Ns=2N_s = 2. This is the value the estimate example uses and the value in every released file, so the released energies equal M/2M/2. In MATLAB, check the normalization with

    sum(abs(h_hat).^2, 'all') / size(h_hat, 3)   % must equal size(h_hat, 2) / meta.nsd
    

    In Python, h5py reports the axes of h_hat in reverse order, [time, receiver, delay].

params

A structure with the following scalar fields:

FieldTypeUnitDescription
fs_delayscalarHzSampling rate fsf_s along the delay axis.
fs_timescalarHzSampling rate along the time axis.
fcscalarHzCenter frequency fcf_c of the signal used during channel estimation.

version

  • Type: Numeric scalar.
  • Description: Dataset format version number (currently 1.0). replay rejects files with a version below 1.0.

Phase/delay tracking fields (optional)

phi_hat, theta_hat, and f_resamp may coexist; replay and unpack apply them according to the following precedence:

  • If none of the three is present, no Doppler correction is applied.
  • phi_hat takes precedence over theta_hat: if phi_hat is present, it is used and theta_hat is ignored; if only theta_hat is present, it is used instead.
  • f_resamp (see Optional fields) is applied independently of the two phase/delay fields, whether or not either of them is present.

The estimation scripts normally save just one phase field: phi_hat when delay tracking is enabled, or theta_hat otherwise. The phi_hat field describes both phase rotation and delay drift, so it takes precedence when both fields are present.

phi_hat (delay tracking)

  • Type: Numeric matrix, size [receiver, time]

  • Units: Radians

  • Sampling rate: params.fs_delay

  • Description: The phase estimate φ^(nTs)\hat\varphi(nT_s), a time-varying phase that encodes both phase rotation and delay drift. In this mode, h_hat holds the drift-free response h‾^(τ,t)\hat{\underline{h}}(\tau, t). Let Δτ\Delta\tau denote the delay drift common to all propagation paths. It is related to the phase by

    φ^(nTs)=−2πfc Δτ(nTs)\hat\varphi(nT_s) = -2\pi f_c\, \Delta\tau(nT_s)

    Unpacking first reinserts the phase, multiplying the drift-free response by ejφ^(nTs)e^{j\hat\varphi(nT_s)} to obtain the signal yˉr(nTs)\bar y_{\text{r}}(nT_s). It then reinserts the delay drift by evaluating that signal at shifted instants,

    vˉr(nTs)=I[yˉr(nTs+φ^(nTs)2πfc)]\bar v_{\text{r}}(nT_s) = \mathcal{I}\left[\bar y_{\text{r}}\left(nT_s + \frac{\hat\varphi(nT_s)}{2\pi f_c}\right)\right]

    where I[⋅]\mathcal{I}[\cdot] denotes interpolation, implemented here as spline interpolation.

    The delay represented by phi_hat accumulates over the recording and can reach hundreds of samples. For a replay starting at sample n0n_0, replay restores the phase relative to that starting point: φ^(nTs)−φ^(n0Ts)\hat\varphi(nT_s) - \hat\varphi(n_0T_s). This aligns the start of the output with the input. The output is padded to accommodate the largest delay drift reached during replay.

theta_hat (phase tracking only)

  • Type: Numeric matrix, size [receiver, time]

  • Units: Radians

  • Sampling rate: params.fs_delay

  • Description: The phase estimate θ^(nTs)\hat\theta(nT_s), a time-varying phase correction. In this mode, h_hat contains the drifting impulse response h^(τ,t)\hat{h}(\tau, t) (delay drift is embedded in the taps). Only the phase is tracked separately. The baseband received signal is modeled as:

    v(t)=∑nd(n) h(t−nT,t) ejθ(t)+w(t)v(t) = \sum_n d(n)\, h(t - nT, t)\, e^{j\theta(t)} + w(t)

    where d(n)d(n) are the transmitted data symbols, h(τ,t)h(\tau, t) is the time-varying impulse response at delay τ\tau and time tt with drifting taps, TT is the symbol interval, θ(t)\theta(t) is the channel phase, and w(t)w(t) is the additive complex baseband noise.

Duration constraint

The phase field (theta_hat or phi_hat) must cover the same duration as h_hat. For theta_hat, this requires:

size(theta_hat, 2) / params.fs_delay == size(h_hat, 3) / params.fs_time

Optional fields

f_resamp

  • Type: Scalar, or vector of size [receiver, 1] or [1, receiver] (double precision)
  • Units: Unitless resampling factor
  • Description: A constant resampling factor, typically the inverse of the factor used to remove the nominal Doppler frequency offset before channel estimation.

A scalar applies to every receiver. A vector supplies one factor per receiver, ordered as in h_hat. The array_index argument selects the corresponding factors, just as it selects receivers in phi_hat.

After the time-varying convolution, replay resamples each output column using its factor, then zero-pads the shorter columns to match the longest. For reconstruction, unpack converts the factor into a linear phase ramp (1/fresamp−1) 2πfct(1/f_{\text{resamp}} - 1)\,2\pi f_c t. It restores this ramp as phase rotation and delay drift using the same procedure as for phi_hat.

meta

The meta structure is optional but strongly encouraged. The following fields are written by the estimate scripts; replay, noisegen, and unpack do not read meta:

FieldTypeDescription
descriptionstringFree-text description of the experiment.
nsdscalarSamples per symbol NsN_s in the delay domain. It sets the normalization of h_hat (see h_hat); 2 when absent.
nstscalarSamples per symbol in the time domain.
K_1scalarAnti-causal filter length [symbols].
K_2scalarCausal filter length [symbols].
fcscalarCenter frequency fcf_c [Hz].
element_spacingscalarArray element spacing ℓ\ell [m].
verticallogicaltrue if vertical array.
delay_trackinglogicaltrue if delay tracking is enabled (phi_hat present).
limitscalarLower dB limit for plotting.
optimscalarOptimizer used: 1 LMS, 2 RLS, 3 SFTF.
muscalarLMS step size μ\mu (when optim == 1).
lambdascalarForgetting factor λ\lambda (when optim == 2 or 3).
regularizationscalarRegularization factor (when optim == 2 or 3).
Kf_1scalarPLL loop filter coefficient Kf1K_{f_1}.
Kf_2scalarPLL loop filter coefficient Kf2K_{f_2}.
nslrscalarDelay tracking rate (when delay_tracking == true).
codenamestringShort identifier for the channel (e.g., "blue_1").

You can add fields to meta for other experiment details.

Noise file format

Each noise .mat file contains the following fields:

FieldTypeDescription
FsscalarSampling rate fsf_s at which noise statistics were measured [Hz].
RscalarBandwidth BB of the recorded noise [Hz]. Despite the field name, this is not the symbol rate RR used on the channel pages.
alphascalarCharacteristic exponent α\alpha of the symmetric α\alpha-stable distribution: 2 Gaussian, < 2 impulsive.
betatensor [M, M, L+1]Mixing coefficients βij(kTs)\beta_{ij}(kT_s) for spatiotemporal noise coloring, where MM is the number of array elements and LL is the maximum lag (both defined below).
fcscalarCenter frequency fcf_c [Hz].
versionscalarNoise struct version number. noisegen rejects files with a version below 1.0.

noisegen reads Fs, alpha, beta, and version. It generates noise at Fs, then resamples it to the requested rate.

The coefficients in beta are normalized across the full array: the expected noise powers of all MM elements sum to MM, and each element keeps its measured power relative to the others. When array_index selects a subset, the sum of the selected elements’ noise powers need not equal the number selected. When α<2\alpha < 2 the variance is undefined, and the pseudo-power 2c22c^2, with cc the scale parameter, takes its place. With the innovations defined below, the expected (pseudo-)power of element ii is

Pi=(∑j=0M−1∑k=0L∣βij(kTs)∣α)2/α,∑i=0M−1Pi=MP_i = \left(\sum_{j=0}^{M-1}\sum_{k=0}^{L}\left|\beta_{ij}(kT_s)\right|^{\alpha}\right)^{2/\alpha}, \qquad \sum_{i=0}^{M-1} P_i = M

For α=2\alpha = 2, PiP_i is the sum of the squared coefficients. noisegen does not rescale the mixed noise, so with all MM elements selected its average power per element is 11, before any resampling.

noisegen uses the mixing equation:

n^i(nTs)=∑j=0M−1∑k=0Lβij(kTs) ηj(nTs+kTs)\hat{n}_i(nT_s) = \sum_{j=0}^{M-1}\sum_{k=0}^{L}\beta_{ij}(kT_s)\,\eta_j(nT_s + kT_s)

Here n^i\hat{n}_i is the synthetically generated noise on hydrophone ii, with the hydrophone indices running as i,j=0,…,M−1i, j = 0, \ldots, M-1. The sampling interval is Ts=1/fsT_s = 1/f_s, where Fs stores fsf_s. The maximum discrete lag with non-negligible covariance is LL, so βij(kTs)\beta_{ij}(kT_s) has L+1L+1 taps, k=0,…,Lk = 0, \ldots, L.

The innovations ηj(nTs)∼Sα(0,1/2)\eta_j(nT_s) \sim \mathcal{S}_\alpha(0, 1/\sqrt{2}) are i.i.d. symmetric α\alpha-stable variates with zero location and scale 1/21/\sqrt{2}; this scale ensures that the distribution reduces to the standard Gaussian N(0,1)\mathcal{N}(0, 1) when α=2\alpha = 2.

The sum runs forward in time, ηj(nTs+kTs)\eta_j(nT_s + kT_s), which is the convention under which beta is estimated by NoiseModels.jl. For an array, mixing backward instead, ηj(nTs−kTs)\eta_j(nT_s - kT_s), reverses the time direction of the correlation between elements while leaving the zero-lag covariance unchanged.

2 - Code Contribution Guide

A guide for contributing to the MATLAB and Python implementations of the channel replay library, covering setup, coding standards, and pull requests.

You can contribute by reporting a bug, suggesting a feature, improving the documentation, or changing the code.

This guide covers the MATLAB and Python repositories in the uwa-channels organization:

RepositoryLanguageMain BranchFolder Layout
uwa-channels/matlabMATLAB (R2021a+)mainsrc/, tests/, examples/, packaging/
uwa-channels/pythonPython (≥ 3.10)mainsrc/uwa_channels/, tests/, examples/

The library’s Julia support is hosted separately, in the UnderwaterAcoustics.jl package maintained by the Acoustic Research Laboratory. Please refer to that repository’s own contribution guidelines for Julia-specific bug reports and pull requests.

The MATLAB and Python implementations must produce consistent results. The calibration suite checks this weekly by running both implementations on the released Zenodo files.

If you change a function’s behavior, make the corresponding change in both repositories. Keep argument order, output length, and indexing conventions consistent with each API. In particular, array_index starts at 1 in MATLAB and at 0 in Python; preserve the existing convention for start as well. The released .mat files are fixed, so changes must remain compatible with them.

Getting started

Prerequisites

  • Familiarity with Git, GitHub, Markdown, and either MATLAB or Python.
    Helpful references: GitHub Quickstart, Markdown Guide.

  • Development environment:

    MATLAB repository

    git clone https://github.com/uwa-channels/matlab.git
    

    To run example scripts, first download blue_1.mat and blue_noise.mat from Zenodo into examples/, then:

    addpath('src')
    cd examples
    example_replay
    

    To run all tests from the repository root (they use matlab.unittest, so they need MATLAB with the Signal Processing Toolbox):

    matlab -batch "addpath('src'); assertSuccess(runtests('tests'))"
    

    Python repository: create a virtual environment and install dependencies:

    git clone https://github.com/uwa-channels/python.git
    cd python
    pip install -r requirements.txt pytest pre-commit
    

    To run example scripts, with blue_1.mat and blue_noise.mat from Zenodo in the working folder:

    PYTHONPATH=src python examples/example_replay.py
    

    To run tests:

    PYTHONPATH=src pytest
    

    The tests in tests/test_zenodo.py replay the released Zenodo files and are skipped by default. Run them with the command below; they download the files to $UWA_CHANNELS_CACHE, or to ~/.cache/uwa-channels:

    PYTHONPATH=src pytest tests/test_zenodo.py --zenodo
    

    To initialize pre-commit:

    pre-commit install
    pre-commit run --all-files
    

Code of conduct

Treat other contributors respectfully and keep feedback constructive.

Bug reports, feature requests, and discussions

Bug reports

  • Search existing issues and pull requests; your bug may already be reported or fixed.
  • Provide a minimal, reproducible example (MATLAB .m file or live script, or a Python snippet), along with:
    • Package version: pip show uwa-channels in Python; in MATLAB, the Underwater Acoustic Channel Toolbox row of matlab.addons.installedAddons, or the VERSION file in a clone
    • OS and MATLAB/Python version, if relevant

Feature requests

Explain what you want to do, why it matters, and how the proposed change would help. Include an example API or workflow if useful.

Discussions

Use GitHub Discussions for questions, design ideas, and future plans.

Issue labels

LabelMeaning
high-priority / low-priorityRelative urgency
good first issueSuitable for newcomers
breaking-changeAPI/behavior change

Issues planned for release are tracked with a GitHub milestone rather than a label.

Workflow for code and documentation changes

  1. Fork the repository and clone your fork.
  2. Create a branch from main, named like topic-short-description (lowercase, hyphen-separated).
  3. Develop locally:
    • MATLAB: run addpath('src'); runtests('tests') from the repository root and address Code Analyzer warnings.
    • Python: run PYTHONPATH=src pytest frequently.
  4. Write tests for new features or bug fixes.
  5. Document your changes:
    • Use NumPy-style docstrings in Python functions and classes.
    • Start each MATLAB function with a help block (H1 line, call forms, inputs, outputs, an example, and a dated revision history), and add a line to the revision history when you change its behavior.
  6. Commit with clear messages, then push to your fork.
  7. Open a pull request (PR) against main. Mark it as “Draft” if it’s not yet ready for review. Reference any related issues.
  8. Address reviewer feedback. Once all checks pass and approvals are received, a maintainer will merge.

Commit message style

Start each commit message with a verb and describe the change. For example:

Start the f_resamp phase ramp at zero, and test that it does
Read MAT v5 files, and fix the beta axis order from h5py

Coding standards

MATLAB

Follow the MATLAB Style Guide:

  • Four-space indentation, as MATLAB’s Smart Indent applies it; snake_case for functions, PascalCase for classes
  • Each function/class in its own .m file
  • Keep src/ working on MATLAB R2021a: validate inputs with assert in a validate_inputs subfunction rather than with arguments blocks
  • Add unit tests as flat files directly under tests/ using MATLAB Unit Test
  • Vectorize where possible; comment non-obvious logic

Python

  • Formatting is enforced via Black and Ruff at 88 columns (Ruff handles import sorting, so a separate isort pass is unnecessary)
  • Static analysis via Flake8, Ruff, mypy, and Bandit
  • Use NumPy-style docstrings with LaTeX equations where helpful
  • Validate public function inputs with validate_inputs before processing. Match the checks in the MATLAB implementation and raise ValueError for invalid inputs. Do not use assert for validation; Python removes it when run with -O.
  • Keep functions short, prefer clarity to cleverness, and avoid premature optimization

Equations in documentation

The same formula needs different delimiters on GitHub and on this site.

  • In Markdown that GitHub renders, such as CONTRIBUTING.md in the MATLAB and Python repositories, write inline math as $`\hat\varphi(nT_s)`$ and display math in a fenced ```math block. A bare $...$ lets GitHub’s Markdown run first, which turns _ into emphasis and \, into a comma, and < inside math should be written \lt.
  • On this site, write $...$ and $$...$$. Hugo renders them with its bundled KaTeX when it builds the site, and params.katex.version in config.toml must name that same KaTeX version, or rules such as the underline in h‾^\hat{\underline{h}} are not drawn. The build checks this with tools/check_katex_css.py.

Testing and continuous integration

RepositoryLocal Test CommandCI Matrix
MATLABmatlab -batch "addpath('src'); assertSuccess(runtests('tests'))"MATLAB R2021a and latest
PythonPYTHONPATH=src pytestPython 3.10–3.13; Zenodo tests on 3.13

All CI checks must pass before a pull request is merged.

Release process

Both repositories follow Semantic Versioning. Do not change the version in a pull request unless a maintainer asks for a release.

  • MATLAB: bump VERSION and the version in CITATION.cff together, then push a tag vX.Y.Z that matches VERSION. The release workflow builds uwa-channels.mltbx on the latest MATLAB, checks that it installs there and on R2021a, attaches it to a GitHub release, and checks that the one-line install works against it.
  • Python: bump version in pyproject.toml and in CITATION.cff together on main. CI then creates the tag vX.Y.Z, publishes a GitHub release with signed distributions, and uploads the package to TestPyPI and PyPI.

Acknowledgements

This guide draws on the UnderwaterAcoustics.jl contributing guide, as well as the contribution guidelines of NumPy and SciPy, and the MATLAB Style Guide.