필터 지우기
필터 지우기

How to truncate number of sample in audiofiles using audioDatastore function in MATLAB?

조회 수: 1 (최근 30일)
Hi all
I am using audiodatadatastore function to classify my speech signal using wavelet scattering . Unfortunately all my audio files are having different length or sample size. I want to make it uniform for all files.
I did try following
% while hasdata(ads)
% [data,info] = read(ads);
%
% if length(data)<45000
% data=[data;zeros(45000-length(data),1)];
% else
% data=data(1:45000);
% end
% end
But that’s of no use. Help is highly appreciated.
  댓글 수: 6
kc
kc 2020년 4월 25일
Yes sir I am using that example only there each speech sample is of 30 sec duration.

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

채택된 답변

Walter Roberson
Walter Roberson 2020년 4월 23일
data(45001, :) = 0;
data = data(1:45000, 1);
No if needed, and handles multiple channels converting to single channel.
  댓글 수: 12
Walter Roberson
Walter Roberson 2020년 4월 25일
It will take me more searching and testing. It turns out that audioDataStore ignores custom readFcn so it might be necessary to recode it for to use a datastore of type 'File'.
kc
kc 2020년 4월 25일
Sir is it possible for you to customise it now. That is the only issue I am facing right now... unequal sample lengths

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Feature Extraction에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by