How to extract specific MFCC from .wav files?

조회 수: 13 (최근 30일)
Ibrahim A
Ibrahim A 2019년 11월 7일
댓글: jibrahim 2020년 12월 17일
When I use the "audioFeatureExtractor" to extract MFCC, since there are 13 MFCC features, I am not sure how to use the setExtractorParams function to pick specific MFCC features? For example, MFCC 1, 4 , 6, and 11.
aFE = audioFeatureExtractor("SampleRate",fs, ...
"mfcc",true);
idx = info(aFE) % output below.
setExtractorParams(aFE,"mfcc",) % not sure how to pick the MFCC features. I don't need all of them.
idx = struct with fields:
mfcc: [1 2 3 4 5 6 7 8 9 10 11 12 13]

채택된 답변

jibrahim
jibrahim 2019년 11월 7일
Hi Ibrahim,
Here you go:
setExtractorParams(aFE,"mfcc","NumCoeffs",11)
  댓글 수: 2
hp
hp 2020년 12월 17일
Y NumCoeffs is 11?plz elaborate the answer
jibrahim
jibrahim 2020년 12월 17일
Sorry, let me clarify.
You use setExtractorParams to set the number of MFCC coefficients to compute. NumCoeffs is a scalar value. This function does not enable you to "pick" specific coefficients But that is easy to do by simply indexing into the output of the audioFeatureExtractor.
[audioIn,fs] = audioread('speech_dft.wav');
aFE = audioFeatureExtractor("SampleRate",fs, ...
"mfcc",true);
% Set the max number of mfccs to compute
setExtractorParams(aFE,"mfcc","NumCoeffs",11)
features = extract(aFE,audioIn);
% Extract the coefficients you are interested in
mfccs = features(:,[1 4 6 11])

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulation, Tuning, and Visualization에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by