블로그: hands on guide to librosa for handling audio files

wonderful world·2022년 5월 8일
0

https://analyticsindiamag.com/hands-on-guide-to-librosa-for-handling-audio-files/

feature extraction

Chromagram

C = np.abs(librosa.stft(data1))
chroma = librosa.feature.chroma_stft(S=C, sr=sr)
fig, ax = plt.subplots(figsize=(10,6))
img = librosa.display.specshow(chroma, y_axis='chroma', x_axis='s', ax=ax)
fig.colorbar(img, ax=ax)
ax.set(title='Chromagram')

Tempogram

oenv = librosa.onset.onset_strength(y=data1, sr=sample_rate)
tempogram = librosa.feature.tempogram(onset_envelope=oenv, sr=sample_rate)

separating the components

files=librosa.ex('brahms')
y,sr = librosa.load(files)
# separate components
y_harmonic, y_percussive = librosa.effects.hpss(y)
# Original file
Audio(y,rate=sr)

another usage

Here you can see the use of spectogram to recognize keyowrds present in the audio clips.

profile
hello wirld

0개의 댓글