This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def beats_to_chords(beat_times, chord_times, chord_labels): | |
'''Propagate lab-style annotations to a list of beat timings. | |
:parameters: | |
- beat_times : ndarray, shape=(m, 2) | |
The time range for beat intervals. | |
The `i`th beat spans time `beat_times[i, 0]` to `beat_times[i, 1]`. | |
`beat_times[0, 0]` should be 0, `beat_times[-1, 1]` should be the track duration. | |
- chord_times : ndarray, shape=(n, 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def delta(data, axis=-1, width=9, order=1, trim=True): | |
'''Compute delta features. | |
:usage: | |
>>> # Compute MFCC deltas, delta-deltas | |
>>> mfccs = librosa.feature.mfcc(y=y, sr=sr) | |
>>> delta_mfcc = librosa.feature.delta(mfccs) | |
>>> delta2_mfcc = librosa.feature.delta(mfccs, order=2) | |
:parameters: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def matching(ref, est, window=0.5): | |
n_ref, n_est = len(ref), len(est) | |
D = np.zeros((n_ref + n_est, n_ref + n_est)) | |
M = (np.abs(np.subtract.outer(ref, est)) <= window).astype(int) | |
# If we build the skew-symmetric adjacency matrix D, then rank(D) = 2 * maximum matching | |
D[:n_ref, n_ref:] = M | |
D[n_ref:, :n_ref] = -M.T |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.