% List of +feature release landmarks % -- change this to suit the feature that you're using % -- change this if you're using closures instead of releases PLUSPHONES={'b+','p+','m+','f+','v+'}; % Get directory listings of all directories given by PLUSPHONES ROOTDIR='/export/ws04ldmk/landmark_waves/'; for I=1:length(PLUSPHONES), PLUSDIRS{I}=dir([ROOTDIR, PLUSPHONES{I}]); end % Load odd-numbered waves to TRAIN, even-numbered waves to TEST for I=0:499, % FILE_NUM and DIR_NUM are ratio and remainder of I/length(PLUSPHONES) FILE_NUM=3+floor(I/length(PLUSPHONES)); DIR_NUM=1+rem(I,length(PLUSPHONES)); % Load the waveform file WAV=wavread([ROOTDIR,PLUSPHONES{DIR_NUM},'/',PLUSDIRS{DIR_NUM}(FILE_NUM).name]); % Convert to mel-scale spectrogram, and load it to TRAIN MSTFT=abs(fft(enframe(WAV,160,40),512,2)); MELGRAM=20*log10(W*MSTFT(:,1:257)'); TRAIN(I+1,:) = MELGRAM(:)'; end