Introduction to pypam

Concepts

The idea of pypam is to process all the acoustic data resulting from an underwater acoustic deployment. For a deployment, we understand a single instrument from the moment it gets into the water until the moment it is taken out. This data is usually stored in different files (and folders), and sometimes has to be zipped because of lack of storage space. Don’t panic, you can still work with zipped folders directly from pypam without having to unzip the whole project. Usually these files have a continuity in time, and very often it is interesting to extract time series.

pypam allows to choose “time window” per AcousticSurvey, which will be the time resolution of the computed output. Then each feature will be computed on that time window (independently of the file duration and sampling frequency). The output is an xarray dataset. The dimensions of these arrays are always:

  • id: id of the bin (increasing integer)

extra coordinates (metadata)

  • datetime: bin start timestamp of the “time window”

  • start_sample: start sample of the bin respect to the file

  • end_sample: end sample of the bin respect to the file

  • id_: id with respect to the file (changes when multiple files per deployment)

Temporal (features) analysis

In bioacoustics, sometimes several frequency bands are interesting to study at the same time and extract features. pypam allows so by passing a list of bands to analyze. Then, a features per “time window” and per frequency band is computed.

For features analysis, the second dimension is:

  • bands: all the bands analyzed (just as an int)

extra coordinates (metadata)

  • band_lowfreq: low limit of the frequency band

  • band_highfreq: high limit of the frequency band

Available features

The available features now are:

Feature name

Type

string

Acoustic Complexity Index (ACI)

acoustic index

aci

Bioacoustic Index (BI)

acoustic index

bi

Spectral Entropy of Shannon (SH)

acoustic index

sh

Temporal Entropy of Shannon (SH)

acoustic index

th

Normalized Difference Sound Index (NDSI)

acoustic index

th

Acoustic Evenness Index (AEI)

acoustic index

aei

Acoustic Diversity Index (ADI)

acoustic index

adi

Zero Crossing Rate (ZCR)

acoustic index

zcr

Acoustic Diversity Index (ADI)

acoustic index

adi

Root Mean Squared Value (rms)

temporal feature

rms

Sound Exposure Level (SEL)

temporal feature

sel

Dynamic Range

temporal feature

dynamic_range

Peak

temporal feature

peak

Root Mean Squared Value Envelope

temporal feature

rms_envelope

Spectrum Slope

temporal feature

spectrum_slope

Frequency domain analysis

pypam allows to compute frequency-domain analysis (spectrum, spectrogram, third octave band levels…) per “time window”

For frequency domain analysis, the second dimension is:
  • frequency: central frequency of the frequency band

In case of spectrograms, a third dimension is added:
  • time: time in seconds of the spectrogram at that specific time window

Frequency domain features

  • spectrogram

  • Spectrum - power_spectrum - psd (power spectral density)

  • Spectral Probability Density (SPD)

  • octave bands