Utilities
The module utils
has a handful of useful set of tools used in the audio analysis framework.
Visualization
|
Creates a random colormap to be used together with matplotlib. |
|
Crop a spectrogram (or an image) in time (horizontal X axis) and frequency (vertical y axis) |
|
Save a list of figures or spectrograms to disk. |
|
Plot the waveform or spectrum of an audio signal. |
|
Plot audio waveform. |
|
Plot power spectral density estimate (PSD). |
|
Display the spectrogram of an audio signal. |
|
Plot spectrogram represenation. |
|
Display bounding boxes with time-frequency regions of interest over a spectrogram. |
|
Overlay centroids on the original spectrogram |
|
Plot features values on a heatmap. |
|
Plot the variation of features values (ie. |
|
Plot a heatmap of a features by time (x-axis) and date (y-axis). |
|
Plot the correlation map between indices in the DataFrame obtained with |
|
Plot shape features in a bidimensional plot. |
|
Create False Color Spectrogram from indices obtained by MAAD. |
Mathematical
|
Compute fast running mean for a window size N. |
|
Get the statistical mode or modal value which is the most common number in the dataset. |
|
Compute the entropy of a vector (waveform) or matrix (spectrogram). |
|
Compute the root-mean-square (RMS) level of an input signal. |
|
Compute the kurtosis (tailedness or curved or arching) of an audio signal. |
|
Compute the skewness (asymetry) of an audio signal. |
|
Computes the first 4th moments of a vector (1d, ie. |
Parser
|
Read Audacity annotations file (or labeling file) and return a Pandas Dataframe with the bounding box and the label of each region of interest (ROI). |
|
Write audio segmentation to text file in Audacity format, a file that can be imported and modified with Audacity. |
|
Read Raven annotations file (or labeling file) and return a Pandas Dataframe with the bounding box and the label of each region of interest (ROI). |
|
Write audio segmentation to text file in Raven format, a file that can be imported and modified with Raven. |
|
Extracts dates from filenames in a given folder and subfolders. |
Miscellaneous
|
Select all the index coresponding to a selected frequency band. |
|
Divide a vector (1D) or a matrix (2D) into multiple bins according to a bin_step with respect of the energy |
Find the closest power of 2 that is superior or equal to the number x. |
|
|
Compute the Run-Length encoding (RLE) of a vector. |
|
Scale the values of a vector or matrix from a user specified minimum to a user specified maximum. |
|
Transform amplitude data (signal, scalar) into decibel scale within the dB range (db_range). |
|
Transform power (amplitude²) signal or scalar into decibel scale within the dB range (db_range). |
|
Transform data in dB scale into amplitude A gain (db_gain) could be added at the end. |
|
Transform data in dB scale into power (amplitude²) A gain (db_gain) could be added at the end. |
|
Compute the average of decibel values. |
|
Computes an addition on decibel values. |
|
Find nearest value on array and return its index. |
|
Extract a single row from a dataframe keeping the DataFrame type (instead of becoming a Series). |
|
Format features such as bounding box coordinates and centroids coordinates to predifined format : time-frequency to pixels or pixels to time-frequency units. |
|
Add a smooth transition (cross-fade) between two audio signals. |
|
Apply a cross-fade to a list of audio signals. |
Xeno-Canto
|
Query metadata from Xeno-Canto website depending on the search terms. |
|
Multi_query performs multiple queries following the search terms defined in the input dataframe |
|
Select a maximum number of recordings depending on their quality and duration in order to create an homogeneous dataset. |
|
Download the audio files from Xeno-Canto based on the input dataframe It will create directories for each species if needed |
Audio metadata
|
Check Wave file consistency. |
|
Get audio header information from WAVE file. |
|
Get information from filename when using standard format. |
|
Get metadata asociated with audio recordings in audio file. |
|
Get metadata asociated with audio recordings in a directory. |