Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Custom Visualizations: Third-Party Libraries

Authors
Affiliations
The Eric and Wendy Schmidt Center for Data Science & Environment
University of California, Berkeley
The Eric and Wendy Schmidt Center for Data Science & Environment
University of California, Berkeley
The Eric and Wendy Schmidt Center for Data Science & Environment
University of California, Berkeley

This notebook demonstrates how to integrate third-party audio/spectrogram libraries with JupyterBioacoustic’s custom visualization interface. Each library’s spectrogram is wrapped in a function that returns the standard viz dict.

Requirements: librosa, scipy (included in demo env). opensoundscape is optional — install separately with pip install opensoundscape (requires PyTorch).

Author: Brookie Guzder-Williams (bguzder-williams@berkeley.edu)
Affiliation: The Eric and Wendy Schmidt Center for Data Science & Environment
[JBA] Debug mode enabled. Logs → /Users/brookie/code/dse/jupyter_bioacoustic/repos/jupyter_bioacoustic/demo/jba_debug.log

1. OpenSoundscape (optional)

OpenSoundscape provides Spectrogram and MelSpectrogram classes with built-in bandpass and trimming. It requires PyTorch, so install separately: pip install opensoundscape.

Skip this section if opensoundscape is not installed — the remaining sections work independently.

Reference: OpenSoundscape Spectrogram Tutorial

Loading...
Loading...

2. Librosa

Librosa is the most widely used Python audio analysis library. Here we wrap several of its spectrogram types: standard STFT, mel, and chromagram.

Reference: Librosa Spectrogram Tutorial

Loading...
Loading...

3. SciPy

SciPy’s signal module provides scipy.signal.spectrogram with configurable window functions. Different windows produce visually distinct spectrograms — here we render each with a different colormap to make the comparison obvious.

Reference: scipy.signal.spectrogram

Loading...
Loading...