mardi 13 septembre 2016

How to insert a random noise to a signal

I have a random signal and I would like to add a random noise to it.

I can add noise to standard signals like Sine, Cosine, Square, sawtooth etc.. by using awgn or randn

But this doesn't work when I try to add the same noise on a random signal like signal = [200 180 160 120 80 80 70 70 65 50 55 120 10 10];

These are the two approaches which I tried:

signal = [200 180 160 120 80 80 70 70 65 50 55 120 10 10 10]; %original signal
plot(signal)
sigma = 0.07; %noise standard deviation
noisy = signal + sigma*randn(size(signal)); %noisy signal
plot(noisy)

OR

signal = [200 180 160 120 80 80 70 70 65 50 55 120 10 10 10];
s = awgn(signal,10,'measured');
plot([signal s])

How can I add noise to these random signals? and why can't I accomplish this task by using standard commands?




Aucun commentaire:

Enregistrer un commentaire