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

temp1(1,:) = O4_1';
temp1(2,:) = O4_2';
temp1(3,:) = O4_3';
temp1(4,:) = M4_1';
temp1(5,:) = M4_2';
temp1(6,:) = M4_3';
temp1(7,:) = N4_1';
temp1(8,:) = N4_2';
temp1(9,:) = N4_3';
temp1(10,:) = J4_1';
temp1(11,:) = J4_2';
temp1(12,:) = J4_3';
temp1(13,:) = B4_1';
temp1(14,:) = B4_2';
temp1(15,:) = B4_3';
temp1(16,:) = E4_1';
temp1(17,:) = E4_2';
temp1(18,:) = E4_3';
temp1(19,:) = S4_1';
temp1(20,:) = S4_2';
temp1(21,:) = S4_3';
% insert more here

h=daubcqf(le,'min');

% Delete the sound input files to save space
clear O4* M4* N4* J4* B4* E4* S4*;

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

FOUR = mean(temp1);

% if you want to see the template

%figure
%plot(FOUR)
%title('FOUR')

