MATLAB: How to add a noise in the Input graph

gaussiangraphiterationMATLABnoiserandomsignalvariance

I have a input signal and i want to add noise to it with zero mean, variance of deviation = 1, sampling time is 600 and maxi deviation (%) is 15. Kindly help?

Best Answer

this code gives a zero mean noise with a sampling rate equal to your signal. just calculate it's amplitude by knowing variance.
t = linspace(0,2*pi,100);
x = sin(t);
an = 0.2; % noise amplitude
noise = an*(rand(size(x))-0.5);
plot(t,x,'r','linewidth',1)
hold on
plot(t, x+noise)