TP-traitement-audio-visuel/TP11/ajout_bruit.m
2023-06-22 20:47:16 +02:00

8 lines
160 B
Matlab
Executable file

function y = ajout_bruit(y,y_bruit,SNR)
E_y = sum(y.^2);
E_bruit = sum(y_bruit.^2);
rapport = sqrt(E_y/(E_bruit*SNR));
y = y+rapport*y_bruit;
y = y/max(y(:));