Skip to content

Instantly share code, notes, and snippets.

@pragatibaheti
Created April 26, 2020 12:19
Show Gist options
  • Save pragatibaheti/02119fcaa664ab30b78cc1a6d282b6a5 to your computer and use it in GitHub Desktop.
Save pragatibaheti/02119fcaa664ab30b78cc1a6d282b6a5 to your computer and use it in GitHub Desktop.
#min = minimum value for each row of the vector signal
#max = maximum value for each row of the vector signal
def normalize(x, axis=0):
return sklearn.preprocessing.minmax_scale(x, axis=axis)
#Plotting the Spectral Centroid along the waveform
librosa.display.waveplot(x, sr=sr, alpha=0.4)
plt.plot(t, normalize(spectral_centroids), color='r')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment