To filter AWGN (Additive White Gaussian Noise) from a pure sine wave in MATLAB, you can use a combination of filtering techniques such as low-pass filtering or statistical methods. Here is an example of how to perform this filtering:
main.m944 chars34 lines
In this example, we first generate a pure sine wave signal with a frequency of 50 Hz. We then add AWGN to the pure sine wave using the awgn
function, which takes the signal and the desired Signal-to-Noise Ratio (SNR) as input parameters.
Next, we filter the noisy signal to remove the AWGN using a low-pass Butterworth filter. The butter
function is used to design the filter and it returns the filter coefficients b
and a
. Then, we use the filtfilt
function to apply the filter to the noisy signal.
Finally, we plot the original pure sine wave, the noisy signal with AWGN, and the filtered signal to visualize the effect of filtering.
Note that you may need to change the values of the parameters such as the sampling frequency, the frequency of the pure sine wave, the SNR, and the cut-off frequency of the filter according to your specific requirements.
gistlibby LogSnag