Noise Generated using awgn and randn do not match!!!

조회 수: 19 (최근 30일)
chess
chess 2017년 7월 12일
답변: Darel 2021년 8월 4일
I am generating noise in two different cases with the same SNR once using awgn command which is a built in command and second time using randn function with the correct scaling however I am getting different noise power in each case.
Following is the script to generate noise using different techniques. Can anyone help me why I am not getting the correct result?
Method 1
A=[1-1i 1+5i 5-4i 3+2i 6-1i 1-3i 2 1+1i -1-0.5i];
Esym=sum(abs(A).^2)/length(A);
SNR=0;
snr=10^((SNR)/10);
Noise=sqrt(Esym/(2*snr))*(randn(1,length(A))+1i*randn(1,length(A)));
A_noisy=A+Noise;
sum(abs(C).^2)/length(C) sum(abs(Noise).^2)/length(Noise) Method 2
B=awgn(A,SNR,'measured');
C=B-A;
The result is as follow:
sum(abs(C).^2)/length(C)
sum(abs(Noise).^2)/length(Noise)
>> noise_testing
ans =
19.4895
ans =
7.9002
As you can see the result is so much different. Can anyone help me to figure out the problem.
Thanks

채택된 답변

Darel
Darel 2021년 8월 4일
You were on the right track. The issue is just that your noise sequence is so short that the noise power for your samples may be substantially different from the overall average power. If you just make the signal and noise sequences longer (maybe something like a thousand points instead of just nine), the results should be much closer whether you use randn() or awgn().

추가 답변 (1개)

Marco
Marco 2017년 10월 3일
Hello, you could find a possible answer at this link: https://it.mathworks.com/matlabcentral/answers/40772-snr-in-awgn
BR Marco

카테고리

Help CenterFile Exchange에서 Transmitters and Receivers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by