mel_filt_norm = [1/5.5, 1/6, 1/6.5, 1/8, 1/9.5, 1/10.5, 1/12, 1/14, 1/16, 1/18.5];
%l1=[52.07	135.16	88.56	173.29	245.09	184.32	108.7	173.3	299.4	328.45];
%thinking that previous l1 is not reliable
l2=[21.51	36.2	111.12	32.65	40.1	30.6	78.53	77.84	80.43	207.76];
l3=[33.14	42.89	88.86	75.43	56.7	59.16	127.68	124.58	125.99	307.25];
l4=[16.08	21.45	57.3	26.05	26.5	40.05	97.76	76.3	97.13	257.19];
%thinking that previous l5 is not that reliable;
%l5=[19.44	37.71	20.43	36.01	32.74	6.48	4.21	7.18	19.3	76.44];
l5=[5.12	24.55	13.53	7.19	8.69	15.69	6.51	8.89	17.27	18.93]./mel_filt_norm;
l6=[10.62	18.43	13.45	7.88	9.55	15.53	9.83	6.79	13.88	16.96]./mel_filt_norm;

sound_array_l=[l2; l3; l4; l5;l6];
n_l=[];
Rank_table_l=[];
%the for loop to get the normalized data of e and the ranking table of each
%row
for n=1:5
        t=sound_array_l(n,:).*mel_filt_norm;
        n_l=[n_l;t];
        g=n_l(n,:);
        [B,I]=sort(g);
        Rank_table_l=[Rank_table_l;I];
end
%the standard array
I_a=[4 5 1 2 6 7 9 3 8 10];
I_e=[1 3 2 7 4 6 8 5 9 10];
I_r=[8 6 7 1 9 2 10 5 3 4];
I_i=[1 8 7 2 9 10 3 6 5 4];
I_o=[7 8 1 4 6 9 2 5 10 3];
I_l=[1 4 5 6 8 7 9 2 3 10];
I_standard=[I_a;I_e;I_i;I_o;I_l;I_r];
%try to compute the square root of the different data;
%seems to be reliable now.
diff_l=0;
diff_array_l=[];
diff_table_l=[];
for l=1:6
    m=I_standard(l,:);
    for k=1:5;
        for i=1:10;
            for j= 1:10;
                if Rank_table_l(k,j)==m(i)
                    diff_l=diff_l+(i-j)^2;
                end
            end
        end
        diff_array_l=[diff_array_l diff_l];
        diff_l=0;
    end
    diff_table_l=[diff_table_l;diff_array_l];
    diff_array_l=[];
end