%find_solo_all_wav 
%  Runs the solo classifier on all eight wav files. Compares 
%  the output of the classifier with the truth data from the
%  label files for each wav file.
%
% Dec-14-2006 ces2130@columbia.edu
function find_solo_all_wav()
figNum = 1;
num_training = 1;
num_test = 7;

total_solo_training = zeros(1,num_training);
total_solo_corrent_training = zeros(1,num_training);
total_non_solo_training = zeros(1,num_training);
total_non_solo_correct_training = zeros(1,num_training);

total_solo_test = zeros(1,num_test);
total_solo_corrent_test = zeros(1,num_test);
total_non_solo_test = zeros(1,num_test);
total_non_solo_correct_test = zeros(1,num_test);

disp('******* Training data **********')

for i=1:num_training
    [total_solo_training(i), total_solo_correct_training(i),...
            total_non_solo_training(i),total_non_solo_correct_training(i),...
            figNum,time_block] = process_wav(figNum,i,1,0);
    
    disp(' ');
    disp(sprintf('training %d.wav:',i));
    disp(sprintf('total seconds solo: %f',...
        total_solo_training(i)*time_block));
    disp(sprintf('percent solo correct: %f',...
        100*total_solo_correct_training(i)/total_solo_training(i)));
    disp(sprintf('total seconds non-solo: %f',...
        total_non_solo_training(i)*time_block));
    disp(sprintf('percent non-solo correct: %f',...
        100*total_non_solo_correct_training(i)/total_non_solo_training(i)));
    
end

sum_solo_training = sum(total_solo_training);
sum_solo_correct_training = sum(total_solo_correct_training);
sum_non_solo_training = sum(total_non_solo_training);
sum_non_solo_correct_training = sum(total_non_solo_correct_training);

disp(' ');
disp(sprintf('sum seconds solo: %f',sum_solo_training*time_block));
disp(sprintf('overall percent solo correct: %f',...
    100*sum_solo_correct_training/sum_solo_training));
disp(sprintf('sum seconds non-solo: %f',sum_non_solo_training*time_block));
disp(sprintf('overall percent non-solo correct: %f',...
    100*sum_non_solo_correct_training/sum_non_solo_training));


disp(' ');
disp(' ');
disp('******* Test data **********')
for i=1:num_test
    [total_solo_test(i), total_solo_correct_test(i),...
            total_non_solo_test(i),total_non_solo_correct_test(i),...
            figNum] = process_wav(figNum,i,0,0);
    
    disp(' ');
    disp(sprintf('test %d.wav:',i));
    disp(sprintf('total seconds solo: %f',...
        total_solo_test(i)*time_block));
    disp(sprintf('percent solo correct: %f',...
        100*total_solo_correct_test(i)/total_solo_test(i)));
    disp(sprintf('total seconds non-solo: %f',...
        total_non_solo_test(i)*time_block));
    disp(sprintf('percent non-solo correct: %f',...
        100*total_non_solo_correct_test(i)/total_non_solo_test(i)));
    
end

sum_solo_test = sum(total_solo_test);
sum_solo_correct_test = sum(total_solo_correct_test);
sum_non_solo_test = sum(total_non_solo_test);
sum_non_solo_correct_test = sum(total_non_solo_correct_test);

disp(' ');
disp(sprintf('sum seconds solo: %f',sum_solo_test*time_block));
disp(sprintf('overall percent solo correct: %f',...
    100*sum_solo_correct_test/sum_solo_test));
disp(sprintf('sum seconds non-solo: %f',sum_non_solo_test*time_block));
disp(sprintf('overall percent non-solo correct: %f',...
    100*sum_non_solo_correct_test/sum_non_solo_test));



figure(figNum);
figNum = figNum+1;

subplot(211)
bar(100*total_solo_correct_training./total_solo_training);
%axis([1 num_training 0 100]);
title('Training data: Percent correct identification of solo');
xlabel('Sample number');
ylabel('Percent');

subplot(212);
bar(100*total_non_solo_correct_training./total_non_solo_training);
%axis([1 num_training 0 100]);
title('Training data: Percent correct identification of non-solo');
xlabel('Sample number');
ylabel('Percent');

figure(figNum);
figNum = figNum+1;

subplot(211)
bar(100*total_solo_correct_test./total_solo_test);
axis([1 num_test 0 100]);
title('Test data: Percent correct identification of solo');
xlabel('Sample number');
ylabel('Percent');

subplot(212);
bar(100*total_non_solo_correct_test./total_non_solo_test);
axis([1 num_test 0 100]);
title('Test data: Percent correct identification of non-solo');
xlabel('Sample number');
ylabel('Percent');




