function[index] = identification(dollar5,dollar10,dollar20,dollar50,dollar100,input,d5deg1,d10deg1,d20deg1,d50deg1,d100deg1,d5deg2,d10deg2,d20deg2,d50deg2,d100deg2,d5deg3,d10deg3,d20deg3,d50deg3,d100deg3,d5deg4,d10deg4,d20deg4,d50deg4,d100deg4,d5deg5,d10deg5,d20deg5,d50deg5,d100deg5,d5deg6,d10deg6,d20deg6,d50deg6,d100deg6,d5deg7,d10deg7,d20deg7,d50deg7,d100deg7,d5deg8,d10deg8,d20deg8,d50deg8,d100deg8,d5deg9,d10deg9,d20deg9,d50deg9,d100deg9,d5deg10,d10deg10,d20deg10,d50deg10,d100deg10)
% This program will test the inputs with all the templates stored. It will
% also determine which is the most likely note.


% Maximum Value to calculate the ratio
ratiofactor = [43008 52224 47616 91136 90624; 
    43520 60928 47104 91648 91136;
    44544 55296 46592 91648 91136;
    45056 54272 46592 92160 91136;
    46080 52736 46592 91648 91136;
    46592 52736 45568 92160 91648;
    47616 54272 46080 92160 91136;
    48128 57344 44544 92160 90624;
    49152 59904 45056 92160 91136;
    50176 61952 44544 92160 89600;
    51200 65024 43520 91648 89088];


% Obtaining maximum correlation and maximum ratio values for all the
% templates and up to 10 degree of skew 
[maxcorrelation(1,:) maxratio(1,:)] = maxcorr11(dollar5,dollar10,dollar20,dollar50,dollar100,ratiofactor(1,:),input);
[maxcorrelation(2,:) maxratio(2,:)] = maxcorr11(d5deg1,d10deg1,d20deg1,d50deg1,d100deg1,ratiofactor(2,:),input);
[maxcorrelation(3,:) maxratio(3,:)] = maxcorr11(d5deg2,d10deg2,d20deg2,d50deg2,d100deg2,ratiofactor(3,:),input);
[maxcorrelation(4,:) maxratio(4,:)] = maxcorr11(d5deg3,d10deg3,d20deg3,d50deg3,d100deg3,ratiofactor(4,:),input);
[maxcorrelation(5,:) maxratio(5,:)] = maxcorr11(d5deg4,d10deg4,d20deg4,d50deg4,d100deg4,ratiofactor(5,:),input);
[maxcorrelation(6,:) maxratio(6,:)] = maxcorr11(d5deg5,d10deg5,d20deg5,d50deg5,d100deg5,ratiofactor(6,:),input);
[maxcorrelation(7,:) maxratio(7,:)] = maxcorr11(d5deg6,d10deg6,d20deg6,d50deg6,d100deg6,ratiofactor(7,:),input);
[maxcorrelation(8,:) maxratio(8,:)] = maxcorr11(d5deg7,d10deg7,d20deg7,d50deg7,d100deg7,ratiofactor(8,:),input);
[maxcorrelation(9,:) maxratio(9,:)] = maxcorr11(d5deg8,d10deg8,d20deg8,d50deg8,d100deg8,ratiofactor(9,:),input);
[maxcorrelation(10,:) maxratio(10,:)] = maxcorr11(d5deg9,d10deg9,d20deg9,d50deg9,d100deg9,ratiofactor(10,:),input);
[maxcorrelation(11,:) maxratio(11,:)] = maxcorr11(d5deg10,d10deg10,d20deg10,d50deg10,d100deg10,ratiofactor(11,:),input);


% Obtaining the index of the maximum ratio value. 
% index of 1 = $5
% index of 2 = $10
% index of 3 = $20
% index of 4 = $50
% index of 5 = $100
[c index] = max(max(maxratio));    



% % y = wavread('10.wav');
% % y1 = wavread('20.wav');
% % y2 = wavread('50.wav');
% % y3 = wavread('100.wav');
% if j == 1
%     disp('note5');
% elseif j == 2
%     disp('note10');    
% %     wavplay(y,21025)
% elseif j == 3
%     disp('note20');  
% %     wavplay(y1,21025)
% elseif j == 4 
%     disp('note50');
% %     wavplay(y2,21025)
% elseif j == 5
%     disp('note100');
% %     wavplay(y3,21025)
% else
%     disp('not recognised');
% end





