SNR and AWGN Question

Hi everyone, I have a question regarding the swgn function. I have a rectangular pulse of magnitude 1 Volts, starting at t=10s for the time period: t=[0:0.01:60] seconds. I want to add a white Gaussian noise of SNR=10 dB to this signal. I use the following comands:
time=0:0.01:60;
i=1;
t=0;
while t<=60
if t>=10
V(i)=1;
else
V(i)=0;
end
i=i+1;
t=t+0.01;
end
Vnoisy = awgn(V,10,'measured'); % Add white Gaussian noise.
plot(time,Vnoisy)
After executing these commands, the maximum of the Vnoisy is 2.0737. In other words, the maximum noise is 2.0737-1=1.0737 Volts. This results in an SNR of 20log(1/1.0737)= -1.422 dB not 10 dB.
Could you please guid me in the right direction?
Thank you!

Answers (0)

Categories

Products

Asked:

on 29 May 2014

Edited:

on 29 May 2014

Community Treasure Hunt

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

Start Hunting!