TP-traitement-audio-visuel/TP11/ajout_bruit.m

8 lines
160 B
Mathematica
Raw Normal View History

2023-06-22 18:47:16 +00:00
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(:));