Reflection Module
The reflection module contains functions for calculating reflection factors and impedances.
Attributes
SPECIFIC_HEAT_RATIO
module-attribute
Specific heat ratio of air \(\gamma\).
POROSITY_DECREASE
module-attribute
Rate of exponential decrease of porosity with depth \(\alpha\).
Classes
Boundary
Boundary(
frequency,
flow_resistivity,
density=DENSITY,
soundspeed=SOUNDSPEED,
porosity_decrease=POROSITY_DECREASE,
specific_heat_ratio=SPECIFIC_HEAT_RATIO,
angle=None,
distance=None,
impedance_model="db",
reflection_model="plane",
)
An object describing a boundary.
| ATTRIBUTE | DESCRIPTION |
|---|---|
frequency |
Frequency. Single value or vector for a frequency range.
|
flow_resistivity |
Flow resistivity \(\sigma\).
|
density |
Density of air \(\rho\). Note: This value is only required for when calculating the impedance according to Attenborough's model.
See
|
soundspeed |
Speed of sound in air \(c\). Note: This value is required when calculating the impedance according to Attenborough's model or when
calculating the spherical wave reflection factor. See respectively
|
porosity_decrease |
Rate of exponential decrease of porosity with depth \(\alpha\). Note: This value is only required for when calculating the impedance according to Attenborough's model.
See
|
specific_heat_ratio |
Ratio of specific heats \(\gamma\) for air. Note: This value is only required for when calculating the impedance according to Attenborough's model.
See
|
angle |
Angle of incidence \(\theta\).
|
distance |
Path length of the reflected ray \(r\). Note: This value is only required for when calculating the spherical wave reflection factor.
See
|
impedance_model |
Impedance model. Note: Possibilities are
|
reflection_model |
Reflection factor model. Note: Possibilities are
|
Source code in acoustic_toolbox/reflection.py
Attributes
wavenumber
property
wavenumber: float
impedance
property
impedance: ndarray
Impedance according to chosen impedance model defined using impedance_model.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the impedance model is incorrect. |
reflection_factor
property
reflection_factor: ndarray
Reflection factor according to chosen reflection factor model defined using reflection_model.
| RAISES | DESCRIPTION |
|---|---|
AttributeError
|
If the angle is not specified. |
AttributeError
|
If the distance is not specified. |
ValueError
|
..shrug.. |
Functions
plot_impedance
plot_impedance(filename=None) -> Figure
Plot magnitude and phase of the impedance as function of frequency.
| PARAMETER | DESCRIPTION |
|---|---|
filename
|
File name to save the plot to.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
Figure
|
The figure.
TYPE:
|
Source code in acoustic_toolbox/reflection.py
plot_reflection_factor
plot_reflection_factor(filename=None) -> Figure
Plot reflection factor.
| PARAMETER | DESCRIPTION |
|---|---|
filename
|
File name to save the plot to.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
Figure
|
The figure.
TYPE:
|
Source code in acoustic_toolbox/reflection.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
Functions
reflection_factor_plane_wave
Plane wave reflection factor \(R\).
| PARAMETER | DESCRIPTION |
|---|---|
impedance
|
Normalized impedance \(Z\).
|
angle
|
Angle of incidence \(\theta\).
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Plane wave reflection factor calculated as: $$ R = \frac{Z \cos{\theta} - 1}{Z \cos{\theta} + 1} $$ |
Source code in acoustic_toolbox/reflection.py
numerical_distance
Numerical distance \(w\).
| PARAMETER | DESCRIPTION |
|---|---|
impedance
|
Normalized impedance \(Z\).
|
angle
|
Angle of incidence \(\theta\).
|
distance
|
Path length of the reflected ray \(r\).
|
wavenumber
|
Wavenumber \(k\).
|
| RETURNS | DESCRIPTION |
|---|---|
complex
|
Numerical distance calculated as: $$ w = \sqrt{-j k r \left( 1 + \frac{1}{Z} \cos{\theta} - \sqrt{1 - \left( \frac{1}{Z} \right)^2} \sin{\theta} \right) } $$ |
Source code in acoustic_toolbox/reflection.py
reflection_factor_spherical_wave
Spherical wave reflection factor \(Q\).
| PARAMETER | DESCRIPTION |
|---|---|
impedance
|
Normalized impedance \(Z\).
|
angle
|
Angle of incidence \(\theta\).
|
distance
|
Path length of the reflected ray \(r\).
|
wavenumber
|
Wavenumber \(k\).
|
| RETURNS | DESCRIPTION |
|---|---|
complex
|
Spherical wave reflection factor calculated as: $$ Q = R \left(1 - R \right) F $$ where \(R\) is the plane wave reflection factor as calculated in reflection_factor_plane_wave and \(F\) is given by $$ F = 1 - j \sqrt{\pi} w e^{-w^2} \mathrm{erfc} \left( j w \right) $$ |
Source code in acoustic_toolbox/reflection.py
impedance_delany_and_bazley
Normalised specific acoustic impedance according to the empirical one-parameter model by Delany and Bazley.
| PARAMETER | DESCRIPTION |
|---|---|
frequency
|
Frequency \(f\).
|
flow_resistivity
|
Flow resistivity \(\sigma\).
|
| RETURNS | DESCRIPTION |
|---|---|
complex
|
Impedance calculated as: $$ Z = 1 + 9.08 \left( \frac{1000f}{\sigma} \right)^{-0.75} - 11.9 j \left( \frac{1000f}{\sigma} \right)^{-0.73} $$ |
Source code in acoustic_toolbox/reflection.py
impedance_attenborough
impedance_attenborough(
frequency,
flow_resistivity,
density=DENSITY,
soundspeed=SOUNDSPEED,
porosity_decrease=POROSITY_DECREASE,
specific_heat_ratio=SPECIFIC_HEAT_RATIO,
)
Normalised specific acoustics impedance according to the two-parameter model by Attenborough.
| PARAMETER | DESCRIPTION |
|---|---|
frequency
|
Frequency \(f\).
|
flow_resistivity
|
Flow resistivity \(\sigma\).
|
soundspeed
|
Speed of sound in air \(c\).
DEFAULT:
|
density
|
Density of air \(\rho\).
DEFAULT:
|
porosity_decrease
|
Rate of exponential decrease of porosity with depth \(\alpha\).
DEFAULT:
|
specific_heat_ratio
|
Ratio of specific heats \(\gamma\) for air.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
complex
|
Impedance calculated as: $$ Z = \frac{\left( 1-j \right) \sqrt{\sigma/f}}{\sqrt{\pi \gamma_0 \rho_0}} - \frac{jc\alpha}{8 \pi \gamma_0 f} $$ |
Source code in acoustic_toolbox/reflection.py
:::