% this file creates a matrix with each sound vector in a row. it then mdwt each row, store it in another matrix, finally return a vector with the average of the coeff's.

% run adj_one.m before running this prog

temp1(1,:) = O1_1';
temp1(2,:) = O1_2';
temp1(3,:) = O1_3';
temp1(4,:) = M1_1';
temp1(5,:) = M1_2';
temp1(6,:) = M1_3';
temp1(7,:) = N1_1';
temp1(8,:) = N1_2';
temp1(9,:) = N1_3';
temp1(10,:) = J1_1';
temp1(11,:) = J1_2';
temp1(12,:) = J1_3';
temp1(13,:) = B1_1';
temp1(14,:) = B1_2';
temp1(15,:) = B1_3';
temp1(16,:) = E1_1';
temp1(17,:) = E1_2';
temp1(18,:) = E1_3';
temp1(19,:) = S1_1';
temp1(20,:) = S1_2';
temp1(21,:) = S1_3';
% insert more here

h=daubcqf(le,'min');

% Delete the sound input files to save space
clear O1* M1* N1* J1* B1 E1* S1*;

for(i = 1: size(temp1,1))
	[temp1(i,:), L] = mdwt(temp1(i,:), h, L);
        %temp1(i,1:3) = zeros(1,1:3);
        %temp1(i,:) = temp1(i,:)/max(temp1(i,:));
end

ONE = mean(temp1);


% if you want to see the template

%figure
%plot(ONE)
%title('ONE')

