How to add white gaussian noise with variance 1 to a signal and calculate the signal-to-noise ratio?
8 views (last 30 days)
Show older comments
Hi. I have a signal that I want to add white gaussian noise to. The variance of the white gaussian noise is 1. Then I will pass it to a low pass filter. Hence, I want to find out the signal-to-noise ratio at both input and output.
After some googling, I understand that I need to use awgn or wgn to add white gaussian noise to the signal. However, I'm getting quite confused with awgn which takes in the signal and signal-to-noise ratio and for wgn, which takes in the M-by-N matrix and power of the noise in dB. I do not have any of the variables and only know that the variance of the white gaussian noise should be 1. Does anyone know how I can add white gaussian noise to the signal? I think I might need to use randn but is not very sure how I can use it.
Can someone help me out?
0 Comments
Accepted Answer
Wayne King
on 25 Sep 2012
Edited: Wayne King
on 25 Sep 2012
Just use randn()
t = 0:0.001:1;
x = cos(2*pi*100*t)+randn(size(t));
To use a different variance, multiply randn() by the square root of the variance
For example, for a variance of 2
noisevec = sqrt(2)*randn(1000,1);
5 Comments
MAHESH MOHAN
on 28 Feb 2013
Hello I've seen somewhere,in which apart multiplying from std deviation of noise signal,also divided it by std deviation of randn function.Could u say the notion behind this..is it some sort of normalization
noise = randn(nRow, nCol); i1 = i+sigma*noise/std2(noise); imshow(i1,[0,255]);title('ORIGINAL IMAGE');
where i is the original image and nrow and ncol its dimensions. Thanku for ur time Mahesh Mohan.M.R
More Answers (0)
See Also
Categories
Find more on Detection, Range and Doppler Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!