function [ signal_normal ] = Normaliseur( signal, type )
%NORMALISEUR( signal, type ) normalise le signal donné en argument par sa
%energie (type = 'energie'), sa puissance (type = 'puissance') ou sa crete (type = 'crete')
    
if strcmp(type, 'energie') || strcmp(type, 'E')
    Esignal = sum(signal.^2);
    norme = sqrt(Esignal);
elseif strcmp(type, 'crete') || strcmp(type, 'C')
    max_signal = max(max(abs(signal)));
    norme = max_signal/0.99;
elseif strcmp(type, 'puissance') || strcmp(type, 'P')
    Psignal = sum(signal.^2)/length(signal);
    norme = sqrt(Psignal);
else
    error('type de normalisation invalide');
end
signal_normal=signal/norme;

end