Skip to content

openstb.simulator.distortion.environmental

Distortions due to environmental effects.

Classes:

Name Description
AnslieMcColmAttenuation

Attenuation of acoustic energy using the simplified Anslie-McColm model.

GeometricSpreading

Amplitude distortion due to geometric spreading of the signal.

AnslieMcColmAttenuation

AnslieMcColmAttenuation(frequency, pH=8.0, transmit=True, receive=True)

Bases: Distortion

Attenuation of acoustic energy using the simplified Anslie-McColm model.

Anslie and McColm model the attenuation due to the chemical relaxation of both boric acid and magnesium sulphate, and the viscous drag of the water. Along with the frequency and operating depth, the temperature, salinity and pH of the water are parameters. For common values, only the salinity has a significant affect. Broadly speaking, the chemical relaxation of boric acid dominates below 1kHz, the chemical relaxation of magnesium sulphate dominates from 10kHz to 100kHz and the viscous drag dominates above 200kHz.

Notes

The model in the paper takes the frequency in kHz and the depth in kilometres. It characterises the chemical relaxations in terms of an attenuation coefficient and a relaxation frequency. Boric acid has a relaxation frequency

\[ f_1 = 0.78\sqrt{(S/35)}\,e^{T/26} \]

and a coefficient

\[ A = 0.106 e^{(\mathrm{pH} - 8)/0.56} \]

for salinity S and temperature T. Similarly, the relaxation frequency of magnesium sulphate is

\[ f_2 = 42e^{T/17} \]

and its attenuation coefficient is

\[ B = 0.52 \left(1 + \frac{T}{43}\right) \left(\frac{S}{35}\right) e^{-D/6} \]

for depth D. Finally, the viscous drag has an attenuation coefficient of

\[ C = 0.00049 e^{-(T/27 + D/17)}. \]

The total attenuation, in dB/km, is then given by

\[ \alpha_a(f) = \frac{Af_1f^2}{f_1^2 + f^2} + \frac{Bf_2f^2}{f_2^2 + f^2} + Cf^2. \]

Parameters:

Name Type Description Default
frequency Literal['min', 'centre', 'max', 'all']

Which frequency or frequencies to calculate the attenuation at. If "min" or "max", use the minimum or maximum frequency in the signal, respectively. When "centre", use the centre frequency, i.e., (min + max) / 2. If "all", calculate the attenuation at each frequency being sampled in the simulation.

required
pH float

The pH of the water.

8.0
transmit bool

Whether to apply attenuation for the transmit path length.

True
receive bool

Whether to apply attenuation for the receive path length.

True
Source code in openstb/simulator/distortion/environmental.py
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
def __init__(
    self,
    frequency: Literal["min", "centre", "max", "all"],
    pH: float = 8.0,
    transmit: bool = True,
    receive: bool = True,
):
    """
    Parameters
    ----------
    frequency
        Which frequency or frequencies to calculate the attenuation at. If "min" or
        "max", use the minimum or maximum frequency in the signal, respectively.
        When "centre", use the centre frequency, i.e., (min + max) / 2. If "all",
        calculate the attenuation at each frequency being sampled in the simulation.
    pH
        The pH of the water.
    transmit
        Whether to apply attenuation for the transmit path length.
    receive
        Whether to apply attenuation for the receive path length.

    """
    if not transmit and not receive:
        raise ValueError(_("transmit and receive cannot both be false"))

    if frequency == "min":
        self._mode = 0
    elif frequency == "max":
        self._mode = 1
    elif frequency == "centre":
        self._mode = 2
    elif frequency == "all":
        self._mode = 3
    else:
        raise ValueError(
            _("unknown value for frequency: {value}").format(value=frequency)
        )

    self.ph = pH
    self.transmit = transmit
    self.receive = receive

GeometricSpreading

GeometricSpreading(power, transmit=True, receive=True)

Bases: Distortion

Amplitude distortion due to geometric spreading of the signal.

Parameters:

Name Type Description Default
power float

The power to use when calculating a one-way spreading loss a = 1/r^power. This is applied to the amplitude, so a power of 1 corresponds to spherical spreading (1/r in amplitude, 1/r^2 in intensity) and a power of 0.5 corresponds to cylindrical spreading.

required
transmit bool

Whether to apply geometric spreading for the transmit path length.

True
receive bool

Whether to apply geometric spreading for the receive path length.

True
Source code in openstb/simulator/distortion/environmental.py
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
def __init__(self, power: float, transmit: bool = True, receive: bool = True):
    """
    Parameters
    ----------
    power
        The power to use when calculating a one-way spreading loss a = 1/r^power.
        This is applied to the amplitude, so a power of 1 corresponds to spherical
        spreading (1/r in amplitude, 1/r^2 in intensity) and a power of 0.5
        corresponds to cylindrical spreading.
    transmit
        Whether to apply geometric spreading for the transmit path length.
    receive
        Whether to apply geometric spreading for the receive path length.

    """
    if not transmit and not receive:
        raise ValueError(_("transmit and receive cannot both be false"))
    self.power = power
    self.transmit = transmit
    self.receive = receive