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 |
|
The 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. |
|
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 a dB-scale spectrogram to a power spectrogram. |
|
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¶
|
Converts frame indices to audio sample indices. |
|
Converts frame counts to time (seconds). |
|
Converts sample indices into STFT frames. |
|
Convert sample indices to time (in seconds). |
|
Converts 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 |
|
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¶
|
Lists all 12 note names in the chromatic scale, as spelled according to a given key (major or minor). |
|
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. |
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. |