Imaging Module
Plotting functions using matplotlib library.
Warning
You need to have matplotlib installed in order to use this module.
Attributes
TICKS_OCTAVE
module-attribute
TICKS_OCTAVE = [
"16",
"31.5",
"63",
"125",
"250",
"500",
"1000",
"2000",
"4000",
"8000",
"16000",
]
Octave center frequencies as strings.
TICKS_OCTAVE_KHZ
module-attribute
Octave center frequencies as strings. Uses kHz notation.
TICKS_THIRD_OCTAVE
module-attribute
TICKS_THIRD_OCTAVE = [
"12.5",
"16",
"20",
"25",
"31.5",
"40",
"50",
"63",
"80",
"100",
"125",
"160",
"200",
"250",
"315",
"400",
"500",
"630",
"800",
"1000",
"1250",
"1600",
"2000",
"2500",
"3150",
"4000",
"5000",
"6300",
"8000",
"10000",
"12500",
"16000",
"20000",
]
Third-octave center frequencies as strings.
TICKS_THIRD_OCTAVE_KHZ
module-attribute
TICKS_THIRD_OCTAVE_KHZ = [
"12.5",
"16",
"20",
"25",
"31.5",
"40",
"50",
"63",
"80",
"100",
"125",
"160",
"200",
"250",
"315",
"400",
"500",
"630",
"800",
"1000",
"1250",
"1600",
"2000",
"2500",
"3150",
"4000",
"5000",
"6300",
"8000",
"10000",
"12500",
"16000",
"20000",
]
Third-octave center frequencies as strings. Uses kHz notation.
Classes
OctaveBandScale
ThirdBandScale
Functions
plot_octave
plot_octave(
data: ndarray,
octaves: ndarray,
axes: Axes | None = None,
kHz: bool = False,
xlabel: str | None = None,
ylabel: str | None = None,
title: str | None = None,
separator: str | None = None,
*args,
**kwargs,
) -> list[Line2D]
Plot octave bands from data levels and octaves bands.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
levels in a 1-D NumPy array.
TYPE:
|
octaves
|
octaves in a 1-D NumPy array.
Note that you can use
TYPE:
|
axes
|
a
TYPE:
|
kHz
|
if
TYPE:
|
xlabel
|
a
TYPE:
|
ylabel
|
a
TYPE:
|
title
|
a
TYPE:
|
separator
|
a
TYPE:
|
*args
|
DEFAULT:
|
**kwargs
|
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
list[Line2D]
|
A list of |
See Also
Source code in acoustic_toolbox/imaging.py
plot_third
plot_third(
data: ndarray,
thirds: ndarray,
axes: Axes | None = None,
kHz: bool = False,
xlabel: str | None = None,
ylabel: str | None = None,
title: str | None = None,
separator: str | None = None,
*args,
**kwargs,
) -> list[Line2D]
Plot third octave bands from data levels and thirds bands.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
levels in an 1-D NumPy array.
TYPE:
|
thirds
|
thirds in an 1-D NumPy array. Note that you can use
TYPE:
|
axes
|
a
TYPE:
|
kHz
|
if
TYPE:
|
xlabel
|
a
TYPE:
|
ylabel
|
a
TYPE:
|
title
|
a
TYPE:
|
separator
|
a
TYPE:
|
*args
|
DEFAULT:
|
**kwargs
|
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
list[Line2D]
|
A list of |
See Also
Source code in acoustic_toolbox/imaging.py
plot_bands
plot_bands(
data: ndarray,
bands: ndarray,
axes: Axes,
band_type: Literal["octave", "third"],
k_ticks: bool = False,
xlabel: str | None = None,
ylabel: str | None = None,
title: str | None = None,
separator: str | None = None,
*args,
**kwargs,
) -> list[Line2D]
Plot bands from data levels and bands.
Only use if you want to plot from arbitrary octave or third octave data.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
levels in an 1-D NumPy array.
TYPE:
|
bands
|
bands in an 1-D NumPy array.
TYPE:
|
axes
|
TYPE:
|
band_type
|
TYPE:
|
k_ticks
|
if
TYPE:
|
xlabel
|
label for x axis.
TYPE:
|
ylabel
|
label for y axis.
TYPE:
|
title
|
title.
TYPE:
|
separator
|
decimal separator. By default takes '.' or ',' values according to system settings (when separator is None).
TYPE:
|
*args
|
additional arguments for
DEFAULT:
|
**kwargs
|
additional arguments for
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
list[Line2D]
|
A list of |
See Also
Source code in acoustic_toolbox/imaging.py
:::