필터 지우기
필터 지우기

Features extraction for multiple audio files.

조회 수: 2 (최근 30일)
Ain Jamil
Ain Jamil 2019년 11월 6일
댓글: Kodali Radha 2021년 8월 10일
audio
I need to extract a features for audio files in folder and save the features in one file. For the 1st row contains all the features for 1st file, 2nd row contains all the features for 2 file and so on. But I have the problem "Unable to perform assignment because the size of the left side is 32769-by-1 and the size of the right side is 32769-by-2." how can solve that. This is my 1st time using matlab
file = dir ('C:\Users\User\Desktop\GP\Audio_Speech_Actors_01-24\8\*.wav');
M= length (file)
for k = 1:M
%pitch extraction
[speech,Fs]= audioread(fullfile('C:\Users\User\Desktop\GP\Audio_Speech_Actors_01-24\8\',file(k).name));
ptch = pwelch(speech,Fs);
signalpitch(k,:) = ptch;
extractpitch = signalpitch (:,:);
%cepstral extraction
%[coeffs,delta,deltaDelta] = mfcc(speech,Fs)
%csvwrite ('cepstral_extraction08.csv',coeffs);
csvwrite('pitch_features08.csv',extractpitch);
end

채택된 답변

Walter Roberson
Walter Roberson 2019년 11월 6일
[speech,Fs]= audioread(fullfile('C:\Users\User\Desktop\GP\Audio_Speech_Actors_01-24\8\',file(k).name));
After that line, speech will be a matrix with as many rows as there are samples, and as many columns as there are input channels. Mono would have one column, stereo would have two columns.
ptch = pwelch(speech,Fs);
pwelch() is able to do its calculations for all channels in the input. It treats each column independently. The result in ptch will have as many columns as there were input channels.
signalpitch(k,:) = ptch;
That line assumes that ptch can be assigned into a single column. That is not the case if the input had more than one channel.
You need to decide what you want to do in the case where there are multiple input channels such as stereo.
Note: the code also assumes that every input file has exactly the same number of samples, which is not a good assumption.
  댓글 수: 1
Ain Jamil
Ain Jamil 2019년 11월 6일
Thank you so much for your explanation..
Really appreciate it..

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

추가 답변 (1개)

Camille Dingam
Camille Dingam 2020년 8월 2일
Hello, please i need to extract ,mfcc feature with 98 dimension. I have many audio file and what i need is that each audio file has only one row of 98 dimensions and after i will do the comparison of them. And even you can help me with the one which is less than 98 dimensions. Thank you for your kind reply
  댓글 수: 1
Kodali Radha
Kodali Radha 2021년 8월 10일
Even I need same. extracting features from multiple audio files nad labeling them with gender

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

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by