SpectralDistances.jl
Measure the distance between two spectra/signals using optimal transport and related metrics
Install / Use
/learn @baggepinnen/SpectralDistances.jlREADME
This repository implements all optimal-transport based distances between spectra detailed in the following pre print
Supplementary material to the paper is provided in a separate repository.
The package also contains a number of generic solvers for optimal transport problems:
- Fixed support in 1d (histograms)
- Varying discrete support (atoms/dirac masses) with non-uniform masses in any dimension
- Barycenters supported on fixed number of atoms, but possibly with non-uniform masses
- Barycentric coordinates
- Continuous support in 1d
See the documentation for instructions.
Installation
using Pkg
pkg"add SpectralDistances"
Interpolation between two rational spectra under four different metrics.
Barycenter of three spectra and mixed spectrum which can be decomposed into a combination of the three input spectra
Example: Barycentric interpolation of spectrograms
The image below illustrates interpolation between 4 Mel spectrograms, each one representing a short whistle. See the folder examples for the code.

See the docs for more examples.
Related Skills
next
A beautifully designed, floating Pomodoro timer that respects your workspace.
product-manager-skills
33PM skill for Claude Code, Codex, Cursor, and Windsurf: diagnose SaaS metrics, critique PRDs, plan roadmaps, run discovery, and coach PM career transitions.
devplan-mcp-server
3MCP server for generating development plans, project roadmaps, and task breakdowns for Claude Code. Turn project ideas into paint-by-numbers implementation plans.
