Noise Generated using awgn and randn do not match!!!
30 views (last 30 days)
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?
A=[1-1i 1+5i 5-4i 3+2i 6-1i 1-3i 2 1+1i -1-0.5i];
sum(abs(C).^2)/length(C) sum(abs(Noise).^2)/length(Noise) Method 2
The result is as follow:
As you can see the result is so much different. Can anyone help me to figure out the problem.
Darel on 4 Aug 2021
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().