soundscapecode
Python implemention of the soundscapecode, for analysing ecoacoustic soundscapes.
See the paper. This implementation is ported from a Matlab example.
Additionally, two sub-modules are provided:
soundscapecode.soundtrap contains utilities for working with data from soundtrap hydrophones.
soundscapecode.filters contains a highpass and bandpass filter compatible with Matlab filters of the same names.
If you use this package in your research, please cite it using the DOI:
Installation and Usage
pip install soundscapecode
Values can be calculated individually:
import soundscapecode as ssc
fs = 48000
mock_sound = np.random.rand(fs*60, 1)
periodicity = ssc.periodicity(mock_sound, fs)
Or to calculate all values for one recording:
from soundscapecode import SoundscapeCode
fs = 48000
n_mins = 3
mock_sound = np.random.rand(fs*n_mins*60, 1)
soundscape = SoundscapeCode(mock_sound, fs)
for dt in soundscape["dt"]:
print(dt)
|
Wrapper for segmenting and calculating soundscape code metrics for a sound. |
|
Holds soundtrap calibration information |
|
Calculates the maximum instantaneous sound pressure level for sound data. |
|
Calculates the root-mean-squared sound pressure level for sound data. |
|
Calculates the periodicity for sound data. |
|
Calculates the kurtosis for sound data. |
|
Calculates the temporal dissimilarity between two sounds. |
|
Calculates the spectral dissimilarity between two mean frequency inputs. |
|
Calculates the dissimilarity index between two sounds and the mean frequency inputs of the sounds. |
|
Convert raw soundtrap values to uPa |
Retrieve soundtrap information from OceanInstruments and save to output path |
|
|
Read soundtrap calibration information from file |
|
Open a wave file |
|
Filter data with a highpass filter |
|
Filter data with a bandpass filter |