how do I add gaussian white noise with 0 mean and 1 std?

i need the noise to be based on the signal

3 Comments

Say what????
N(0,1) --> randn; what's the problem?
"based on"??? Do you mean "added onto"? If the mean is 0, and the std dev is 1, then you have nothing left to control that would let it be dependent on your signal in any way.

Sign in to comment.

Answers (1)

moyenne=0; % mean
ecart_type=1; % std
t=0:0.1:10
signal=10*sin(t) % your signal
noise= moyenne + ecart_type*randn(1,numel(signal));
out=signal+noise; % for example
plot(out)

4 Comments

My question was/is what did OP mean with "need the noise to be based on the signal" while adding N(0,1) (which your answer does)? The question makes no sense.
thank you Mr azzi for your help, let us suppose that we have a different signals with different values(some values are very small and the others are very large) i need the to add noise depend on those signal...i hope u understand what i want for ex: suppose the signal is >> signal=10000*sin(t); % your signal try to see the noise that you added please.
Then scale by the magnitude of the signal by some form...if you want the noise to be some percentage of the signal pk-pk, say, then adjust the sampled variance in proportion.
moyenne=0; % mean
t=0:0.1:10 % time
signal=10*sin(t) % your signal
ecart_type=abs(signal*.05) % variable std 5%
noise= moyenne + ecart_type.*randn(1,numel(signal));
out=signal+noise;
plot(out)

Sign in to comment.

Categories

Asked:

on 28 Jul 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!