How to add Gaussian white noise with different signal-to-noise ratio to the original signal in MATLAB

1. Gaussian white noise

White noise: power spectral density obeys uniform distribution;
Gaussian: noise amplitude distribution obeys Gaussian distribution;
Definition 1: If a noise, its instantaneous value obeys Gaussian distribution, and its power spectral density is uniformly distributed, it is called it It is Gaussian white noise.
Definition 2: In the operating frequency range of a general communication system, the spectrum of thermal noise is evenly distributed, and the spectrum similar to white light is evenly distributed in the spectrum of visible light, so thermal noise is often called white noise. Because thermal noise is produced by the movement of a large number of free electrons, and its statistical characteristics obey Gaussian distribution, thermal noise is often called Gaussian white noise.

2. Signal to noise ratio

SNR: The strength of the signal divided by the strength of the noise (or the ratio of signal power to noise power).
Insert picture description here

Signal strength: In the continuous case, the signal x is squared and then integrated, and in the discrete case, the sum replaces the integral. The calculation formula is as follows:
sigPower=sum(abs(sig(: )).^2)/length(sig(: ))
Among them, sig(:) is the signal.

3.wgn function and awgn function

Whether it is the wgn or awgn function in matlab, the essence is the noise generated by the randn function. That is: the randn function is called in the wgn function, and the wgn function is called in the awgn function.

1). WGN: Generate Gaussian white noise

y = wgn(m,n,p): Generate a matrix of m rows and n columns of Gaussian white noise, p specifies the output noise intensity in dB(W);
y = wgn(m,n,p,imp) : Specify the load impedance in ohms (Ohm);
y = wgn(m,n,p,imp,state) Reset the state of RANDN.

Some iconic parameters can be added after the numerical variable:

y = wgn(...,POWERTYPE): Specify the unit of p; POWERTYPE can be'dBW','dBm' or'linear'; linear power (linear power) is in watts (Watt).
y = wgn(...,OUTPUTTYPE): Specify the output type; OUTPUTTYPE can be'real' or'complex'.

2). AWGN: add Gaussian white noise to a signal

y = awgn(x,SNR) adds Gaussian white noise to the signal x. The signal-to-noise ratio SNR is in dB. The intensity of x is assumed to be 0dB(W). If x is complex, add complex noise.
y = awgn(x,SNR,SIGPOWER) If SIGPOWER is a numeric value, it represents the signal strength in dB(W); if SIGPOWER is'measured', the function will measure the signal strength before adding noise.
y = awgn(x,SNR,SIGPOWER,STATE) Reset the state of RANDN.
y = awgn(...,POWERTYPE): Specify the unit of SNR and SIGPOWER; POWERTYPE can be'dB' or'linear'. If POWERTYPE is'dB', then SNR is in dB, and SIGPOWER is in dBW. If POWERTYPE is'linear', then SNR is measured as a ratio, and SIGPOWER is measured in watts.

References
[1] Signal-to-noise ratio, adding Gaussian white noise
[2] The use of WGN and AWGN functions of white noise in MATLAB and the calculation of signal-to-noise ratio
[3] Matlab signal adding noise and SNR calculation

Guess you like

Origin blog.csdn.net/weixin_45317919/article/details/107451898