function fr = synthese_haar(fw,n)
    nb=size(fw,1);
    Jmax=log2(nb)-1;
    if n>Jmax error('Impossible sur autant de niveaux!'); end
    Jmin=0;
    frt=fw;
    for j=Jmin:n
        Coarse=frt(1:2^j);
        Detail=frt(2^j+1:2^(j+1));
        frt(1:2:2^(j+1))=(Coarse+Detail)/sqrt(2);
        %frt(2:2:2^(j+1)= ; A completer
    end
    fr=frt(1:2^(n+1));
    
    %Affichage du signal reconstruit
    j1=Jmax-n;
    figure; plot(1:2^j1:nb,fr, '.-'); axis('tight');
    title(strcat(['Partial reconstruction, j=' num2str(j1)]));
end

