๐Ÿ Python & library/librosa

[Librosa] music/audio processing library Librosa ์‚ฌ์šฉ๋ฒ• Tutorial - (4) Audio feature processing

๋ณต๋งŒ 2021. 9. 23. 21:58

music/audio processing library Librosa ์‚ฌ์šฉ๋ฒ• Tutorial

(1) Install, import and load

(2) Audio data representations (Spectogram, Mel-spectogram)

(3) Audio feature extraction

(4) Audio feature processing

 

 

(3)์—์„œ ์ถ”์ถœํ•œ Audio feature์„ ๊ฐ€์ง€๊ณ  ์ถ”๊ฐ€์ ์ธ processing์„ ํ•˜์—ฌ ์ˆ˜ํ–‰ํ•  task์˜ ์„ฑ๋Šฅ์„ ๋†’์ผ ์ˆ˜ ์žˆ๋‹ค.

 

Using Delta and Double-delta

Feature์˜ delta(1์ฐจ ์ฐจ๋ถ„)์™€ double-delta(2์ฐจ ์ฐจ๋ถ„) ๊ฐ’๋“ค์„ ์ด์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. 

 

์•„๋ž˜ ์ฝ”๋“œ๋Š” 13-dim mean mfcc์˜ delta์™€ double-delta๋ฅผ ๊ตฌํ•ด 39 ์ฐจ์› feature๋ฅผ ๋งŒ๋“œ๋Š” ์˜ˆ์ œ์ด๋‹ค.

y, sr = librosa.load(librosa.ex('trumpet'))
mfcc = librosa.feature.mfcc(y=y, sr=sr, n_mfcc=13)
mfcc_delta = librosa.feature.delta(mfcc)
mfcc_delta2 = librosa.feature.delta(mfcc, order=2)

feature = np.concatenate((mfcc.mean(axis=1), 
                          mfcc_delta.mean(axis=1), 
                          mfcc_delta2.mean(axis=1)))

 

๋ฐ˜์‘ํ˜•