You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7 lines
149 B
Matlab

function [ y ] = addnoise( x, snr_db )
v = 10^(-snr_db/10);
y=x+sqrt(v)*(randn(size(x))+1i*randn(size(x)))/sqrt(2);
y=y/sqrt(mean(y.*conj(y)));
end