How to add White Gaussian Noise to Signal using MATLAB ?
In this article, we are going to discuss the addition of “White Gaussian Noise” to signals like sine, cosine, and square wave using MATLAB. The white Gaussian noise can be added to the signals using MATLAB/GNU-Octave inbuilt function awgn(). Here, “AWGN” stands for “Additive White Gaussian Noise”.
AWGN is a very basic noise model commonly used in the communication system, signal processing, and information theory to imitate the effect of random processes that occur in nature.
We normally have different syntaxes for awgn() function depending on the number and type of parameters passed to it. But here, we will study only two syntaxes of it which are most commonly used in the communication system and signal processing.
This syntax will add the white Gaussian noise to the passed input_signal and maintains the passed SNR (signal to noise ratio) in dB. By default this syntax considers the power of the input_signal as 0 dBW (decibel watt).
awgn(input_signal, snr, signal_power)
This syntax will do the same thing as the first one but the only difference is, here the power of the input_signal is not considered as zero rather it has to be passed as one of the arguments along with the input_signal and snr.
Note: Signal power can be passed as “measured” or some scalar value to set the signal level of the input_signal, according to which the appropriate noise level is determined based on the value of snr.
Let’s understand the implementation with the help of an example where we will add the gaussian white noise to the sine waves.
Step 1: Define the required parameters
Step 2: Define the input signal and plot
Step 3: Add white Gaussian noise to signal and plot
Let’s see another example Addition of white Gaussian noise to square wave. We have to follow the same three steps as above to add the white Gaussian noise to the square wave. But this time we will plot both the input signal and the noisy signal simultaneously in the same figure to analyze the changes carefully.