function fw=analyse_haar(f)
    n=size(f,1);
    Jmax=log2(n)-1;
    Jmin=0;
    fw=f;
    clf;
    subplot(4,1,1);
    plot(f);
    axis('tight'); title('Signal');
    for j=Jmax:-1:Jmin
        A=fw(1:2^(j+1));
        Coarse=(A(1:2:length(A))+A(2:2:length(A)))/sqrt(2); %Approximation
        Detail=(A(1:2:length(A))-A(2:2:length(A)))/sqrt(2); %Détails
        A=[Coarse; Detail];
        fw(1:2^(j+1))=A;
        j1=Jmax-j;
        if j1<3
            subplot(4,1,j1+2);
            plot(1:2^(j1+1):n,Detail,'.-');
            axis('tight');
            title(strcat(['Details,j=' num2str(j)]));
        end
    end
end