matlab - Create single .mat file by using multiple wave signal -
i want prepare training , testing set automatic speech recognition using matlab toolbox. have sample set containing several recorded audio (.wav). new matlab. in order use toolbox need create training ad testing set save in .mat file. question how create single .mat file containing audio? million.
to create disjoint training , testing set, best method use crossvalind
command. performs cross-validation of k-fold
k
parameter given input. if k=5
1/5th
data used testing , 4/5th
data used training. code follows:
data=randi(20,[500 20]); %creating random data 500 rows , 20 columns. indices=crossvalid('kfold',size(data,1),5); test = (indices == 2); %you can put number between 1 5 train = ~test; traindata=data(train,:); testdata=data(test,:); savefile='datafile.mat' save(savefile,'traindata','testdata');
if change number 2 other number, train-test data same distribution , random each time. can put in loop saving, need use tricks or manually placing breakpoint each point avoid data getting overwritten. general technique create train-test sets. hope able apply problem.
Comments
Post a Comment