Caution
You're reading an old version of this documentation. If you want up-to-date information, please have a look at 0.9.1.
Core IO and DSP¶
Audio processing¶
|
Load an audio file as a floating point time series. |
|
Stream audio in fixed-length buffers. |
|
Force an audio signal down 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. |
|
Bounded auto-correlation |
|
Linear Prediction Coefficients via Burg's method |
|
Find the zero-crossings of a signal y: indices i such that sign(y[i]) != sign(y[j]). |
|
Returns a signal with the signal click placed at each specified time |
|
Returns a pure tone signal. |
|
Returns a chirp signal that goes from frequency fmin to frequency fmax |
|
mu-law compression |
|
mu-law expansion |
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. |
|
Time-frequency representation using IIR filters [Rd4077732470d-1]. |
|
The fast Mellin transform (FMT) [R6343f8d4cac9-1] of a uniformly sampled signal y. |
|
Approximate magnitude spectrogram inversion using the "fast" Griffin-Lim algorithm [R047f50301c96-1] [R047f50301c96-2]. |
|
Approximate constant-Q magnitude spectrogram inversion using the "fast" Griffin-Lim algorithm [Re33fb425db1f-1] [Re33fb425db1f-2]. |
|
Compute the energy at harmonics of time-frequency representation. |
|
Harmonic salience function. |
|
Phase vocoder. |
|
Separate a complex-valued spectrogram D into its magnitude (S) and phase (P) components, so that D = S * P. |
Get the FFT library currently used by librosa |
|
|
Set the FFT library used by librosa. |
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 A-weighting of a set of frequencies. |
|
Per-channel energy normalization (PCEN) [Rb388d53f6b92-1] |
Time and frequency 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) |
|
Convert one or more frequencies (in Hz) to the nearest note names. |
|
Get MIDI note number(s) for given frequencies |
|
Get the frequency (Hz) of MIDI note(s) |
|
Convert one or more MIDI numbers to note strings. |
|
Convert one or more note names to frequency (Hz) |
|
Convert one or more spelled notes to MIDI number(s). |
|
Convert Hz to Mels |
|
Convert frequencies (Hz) to (fractional) octave numbers. |
|
Convert mel bin numbers to frequencies |
|
Convert octaves numbers to frequencies. |
|
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. |
|
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. |
Pitch and tuning¶
|
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. |
Deprecated¶
|
Compute the instantaneous frequency (as a proportion of the sampling rate) obtained as the time-derivative of the phase of the complex spectrum as described by [Ra44d590316d7-1]. |