Skip to content

Instantly share code, notes, and snippets.

@ctralie
Created August 9, 2025 14:48
Show Gist options
  • Save ctralie/e492dd82103e2e1e50d96c6319133b55 to your computer and use it in GitHub Desktop.
Save ctralie/e492dd82103e2e1e50d96c6319133b55 to your computer and use it in GitHub Desktop.
import librosa
y, sr = librosa.load("YoutubeIntro.m4a")
hop = 512
X = librosa.feature.mfcc(y=y[0:sr*10], sr=sr, hop_length=hop, n_mfcc=13)
# Perform a sliding window embedding of length 20 to emphasize diagonals
X = librosa.feature.stack_memory(X, n_steps=20).T
D = get_distmat(X)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment