How can i add white Gaussian noise to signal.
Now, i'm using awgn function but it doesn't work.
Am i give an incorrect parameter?
EDITED
x = -2:.002:2;
% Initail variables
M = 0;
V = 500*10^(-6);
% Creating a singal
T = -pi + (pi+pi)*rand(1,1);
S = (13.5)*cos(2*pi*x+T);
% Creating Noise singal
W = M+sqrt(V)*rand(1,2500);
% Adding Noise to signal // This doesn't work
SW = awgn(S,W,'measured');
% or this doesn't work too
SW = S + W;
Thanks in advance.
x
). I assume that your vectorsS
andW
don't have the same size, otherwiseSW = S+W;
should definetly work. Just to be sure: tryW = M+sqrt(V)*rand(size(S));
– hbaderts