Is noise with awgn function or randn fucntion can guarantee SNR?
54 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (1 件)
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)
[x2,np]=awgn(x,SNR,'measured'); %noisy signal method 2
snr2 = snr(x2)
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!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Propagation and Channel Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!