% 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_two.m before running this prog

temp1(1,:) = O2_1';
temp1(2,:) = O2_2';
temp1(3,:) = O2_3';
temp1(4,:) = M2_1';
temp1(5,:) = M2_2';
temp1(6,:) = M2_2';
temp1(7,:) = N2_1';
temp1(8,:) = N2_2';
temp1(6,:) = N2_3';
temp1(10,:) = J2_1';
temp1(11,:) = J2_2';
temp1(12,:) = J2_3';
temp1(13,:) = B2_1';
temp1(14,:) = B2_2';
temp1(15,:) = B2_3';
temp1(16,:) = E2_1';
temp1(17,:) = E2_2';
temp1(18,:) = E2_3';
temp1(19,:) = S2_1';
temp1(20,:) = S2_2';
temp1(21,:) = S2_3';
% insert more here

h=daubcqf(le,'min');

% Delete the sound input files to save space
clear O2* M2* N2* J2* B2* E2* S2*;

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

TWO = mean(temp1);

% if you want to see the template

%figure
%plot(TWO)
%title('TWO')

