Is noise with awgn function or randn fucntion can guarantee SNR?

조회 수: 81 (최근 30일)
민각 김
민각 김 2022년 7월 12일
답변: Pooja Kumari 2023년 9월 15일
I saw 2 ways to add WGN
1st is noise_power/sqrt(2)*(randn+1j*randn)
2nd is awgn(signal,SNR,signal_power)
I think these 2 method cant guarantee SNR because of random (of course awgn fucntion is random too)
Am i thinking right?

답변 (1개)

Pooja Kumari
Pooja Kumari 2023년 9월 15일
Hello,
I understand that you want to know if two different methods of adding noise to a signal can guarantee SNR or not. There are two ways to add White Gaussian noise either by using “randn” function or by “awgn” function, we cannot guarantee SNR for real scenarios. However, the simulations for noise that we perform in MATLAB should achieve the exact noise levels as we want.
The “randn” function generates random numbers from a standard normal distribution, which can be used to generate Gaussian noise. However, using “randn” alone does not guarantee a specific SNR.
On the other hand, the “awgn” function in MATLAB is used to add additive white Gaussian noise (AWGN) to a signal. It allows you to specify the desired signal-to-noise ratio (SNR) to achieve a specific level of noise in the signal.
Here is a code snippet for your understanding:
t=linspace(0,10,1000);
x=sin(2*pi*0.01.*t+pi/3).*cos(2*pi*0.01.*t+pi/3); %Original signal
n=2*randn(size(x)); %white noise
xn=x+n; %noisy signal method 1
SNR = snr(xn)
SNR = -12.8873
[x2,np]=awgn(x,SNR,'measured'); %noisy signal method 2
snr2 = snr(x2)
snr2 = -12.6339
You can refer to the documentation for more information on “awgn” function :
You can refer to the below documentation for more information on “snr” function:
I hope this helps!

카테고리

Help CenterFile Exchange에서 Propagation and Channel Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by