MATLAB Code, Lab Report and a Power Point Presentation

profileDA.777
test_yes_no.m

% Use this program to test the accuracy of your yes/no recognition % program, which must be in the file yes_no.m. % Written by Joe Hoffbeck 4/7/02 N = 25; % number of yes files, and number of no files correct = 0; % initialize counter for i = 1:N, % test the 'yes' files first filename = ['speech_training_files\yes',int2str(i),'.wav']; % build filename [x,fs,bits] = wavread(filename); % load file y = yes_no(x,fs); if strcmpi(y,'yes'), correct = correct + 1; elseif strcmpi(y,'no') fprintf('%s was recognized incorrectly.\n',filename) else fprintf('Unrecognized output on %s: %s\n',filename,y) end end for i = 1:N, % test the 'no' files next filename = ['speech_training_files\no',int2str(i),'.wav']; % build filename [x,fs,bits] = wavread(filename); % load file y = yes_no(x,fs); if strcmpi(y,'no'), correct = correct + 1; elseif strcmpi(y,'yes') fprintf('%s was recognized incorrectly.\n',filename) else fprintf('Unrecognized output on %s: %s\n',filename,y) end end fprintf('You got %d correct out of %d on speech training samples\n\n\n\n',correct,2*N);