Skip to content

Instantly share code, notes, and snippets.

View bmcfee's full-sized avatar

Brian McFee bmcfee

View GitHub Profile
@bmcfee
bmcfee / ks_key.py
Created September 7, 2017 19:02
Krumhansl-Schmuckler key estimation
import numpy as np
import scipy.linalg
import scipy.stats
def ks_key(X):
'''Estimate the key from a pitch class distribution
Parameters
----------
X : np.ndarray, shape=(12,)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmcfee
bmcfee / stride_tricks.ipynb
Created January 18, 2014 22:27
Using stride tricks to simulate a sliding window on a huge time series
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmcfee
bmcfee / gist:9255038
Created February 27, 2014 17:40
corrected delta feature implementation
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:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, this is too big to display.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.