Core IO and DSP
Audio loading
|
Load an audio file as a floating point time series. |
|
Stream audio in fixed-length buffers. |
|
Convert an audio signal to mono by averaging samples across channels. |
|
Resample a time series from orig_sr to target_sr |
|
Compute the duration (in seconds) of an audio time series, feature matrix, or filename. |
|
Get the sampling rate for a given file. |
Time-domain processing
|
Bounded-lag auto-correlation |
|
Linear Prediction Coefficients via Burg's method |
|
Find the zero-crossings of a signal |
|
mu-law compression |
|
mu-law expansion |
Signal generation
|
Construct a "click track". |
|
Construct a pure tone (cosine) signal at a given frequency. |
|
Construct a "chirp" or "sine-sweep" signal. |
Spectral representations
|
Short-time Fourier transform (STFT). |
|
Inverse short-time Fourier transform (ISTFT). |
|
Time-frequency reassigned spectrogram. |
|
Compute the constant-Q transform of an audio signal. |
|
Compute the inverse constant-Q transform. |
|
Compute the hybrid constant-Q transform of an audio signal. |
|
Compute the pseudo constant-Q transform of an audio signal. |
|
Compute the variable-Q transform of an audio signal. |
|
Time-frequency representation using IIR filters |
|
Fast Mellin transform (FMT) |
|
Separate a complex-valued spectrogram D into its magnitude (S) and phase (P) components, so that |
Phase recovery
|
Approximate magnitude spectrogram inversion using the "fast" Griffin-Lim algorithm. |
|
Approximate constant-Q magnitude spectrogram inversion using the "fast" Griffin-Lim algorithm. |
Harmonics
|
Compute the energy at harmonics of time-frequency representation. |
|
Harmonic salience function. |
|
Compute the energy at selected harmonics of a time-varying fundamental frequency. |
|
Phase vocoder. |
Magnitude scaling
|
Convert an amplitude spectrogram to dB-scaled spectrogram. |
|
Convert a dB-scaled spectrogram to an amplitude spectrogram. |
|
Convert a power spectrogram (amplitude squared) to decibel (dB) units |
|
Convert dB-scale values to a power values. |
|
Perceptual weighting of a power spectrogram. |
|
Compute the weighting of a set of frequencies. |
|
Compute multiple weightings of a set of frequencies. |
|
Compute the A-weighting of a set of frequencies. |
|
Compute the B-weighting of a set of frequencies. |
|
Compute the C-weighting of a set of frequencies. |
|
Compute the D-weighting of a set of frequencies. |
|
Per-channel energy normalization (PCEN) |
Time unit conversion
|
Convert frame indices to audio sample indices. |
|
Convert frame counts to time (seconds). |
|
Convert sample indices into STFT frames. |
|
Convert sample indices to time (in seconds). |
|
Convert time stamps into STFT frames. |
|
Convert timestamps (in seconds) to sample indices. |
|
Convert block indices to frame indices |
|
Convert block indices to sample indices |
|
Convert block indices to time (in seconds) |
Frequency unit conversion
|
Convert one or more frequencies (in Hz) to the nearest note names. |
|
Get MIDI note number(s) for given frequencies |
|
Convert frequencies (in Hz) to Hindustani svara |
|
Convert frequencies (in Hz) to Carnatic svara |
|
Convert one or more frequencies (in Hz) from a just intonation scale to notes in FJS notation. |
|
Get the frequency (Hz) of MIDI note(s) |
|
Convert one or more MIDI numbers to note strings. |
|
Convert MIDI numbers to Hindustani svara |
|
Convert MIDI numbers to Carnatic svara within a given melakarta raga |
|
Convert one or more note names to frequency (Hz) |
|
Convert one or more spelled notes to MIDI number(s). |
|
Convert western notes to Hindustani svara |
|
Convert western notes to Carnatic svara |
|
Convert Hz to Mels |
|
Convert frequencies (Hz) to (fractional) octave numbers. |
|
Convert mel bin numbers to frequencies |
|
Convert octaves numbers to frequencies. |
|
Convert a reference pitch frequency (e.g., |
|
Convert a tuning deviation (from 0) in fractions of a bin per octave (e.g., |
Music notation
|
List all 12 note names in the chromatic scale, as spelled according to a given key (major or minor) or mode (see below for details and accepted abbreviations). |
|
Construct the diatonic scale degrees for a given key. |
|
Spell the Carnatic svara names for a given melakarta raga |
|
Construct the svara indices (degrees) for a given melakarta raga |
|
Construct the svara indices (degrees) for a given thaat |
List melakarta ragas by name and index. |
|
List supported thaats by name. |
|
|
Calculate the note name for a given number of perfect fifths from a specified unison. |
|
Convert an interval to Functional Just System (FJS) notation. |
|
Construct a set of frequencies from an interval set |
|
Pythagorean intervals |
|
Construct p-limit intervals for a given set of prime factors. |
Frequency range generation
|
Alternative implementation of np.fft.fftfreq |
|
Compute the center frequencies of Constant-Q bins. |
|
Compute an array of acoustic frequencies tuned to the mel scale. |
|
Compute the frequencies (in beats per minute) corresponding to an onset auto-correlation or tempogram matrix. |
|
Compute the frequencies (in beats per minute) corresponding to a Fourier tempogram matrix. |
Pitch and tuning
|
Fundamental frequency (F0) estimation using probabilistic YIN (pYIN). |
|
Fundamental frequency (F0) estimation using the YIN algorithm. |
|
Estimate the tuning of an audio time series or spectrogram input. |
|
Given a collection of pitches, estimate its tuning offset (in fractions of a bin) relative to A440=440.0Hz. |
|
Pitch tracking on thresholded parabolically-interpolated STFT. |
Miscellaneous
|
Return an array of sample indices to match the time axis from a feature matrix. |
|
Return an array of time values to match the time axis from a feature matrix. |
Get the FFT library currently used by librosa |
|
|
Set the FFT library used by librosa. |