% Collect the data for su/v detection % Roger Jang, 20060327, 20070417 clear all; toolboxAdd; % Add toolboxes to the search path. Modify toolboxAdd.m to use your locations of the toolboxes. waveDir='trainDataByRoger'; % Directory of wave files. Change this to the directory holding everyone's recordings. fprintf('Collecting wave data and features from "%s"...\n', waveDir); pvData=recursiveFileList(waveDir, 'pv'); % Collect all wave files for i=1:length(pvData) pvFile=pvData(i).path; waveFile=strrep(pvFile, '.pv', '.wav'); fprintf('%d/%d ==> Collect features from %s\n', i, length(pvData), waveFile); [pvData(i).inData, pvData(i).outData, inputName, pvData(i).annotation]=mySuvFeaExtract(waveFile); end % Save the collect data to DS.mat DS.inputName=inputName; DS.input=[pvData.inData]; DS.output=double([pvData.outData])+1; % Make the output 1 or 2 DS.outputName={'No pitch', 'With pitch'}; DS.annotation=[pvData.annotation]; % Pay attention: This is [], not {}! fprintf('Save DS to DS.mat ...\n'); save DS.mat DS