To filter AWGN (Additive White Gaussian Noise) from a sinusoidal sequence in MATLAB, you can use a filter design and implementation approach.
First, create a sinusoidal signal with AWGN:
main.m203 chars8 lines
Next, design a filter to remove the noise. A common approach is to use a low-pass filter to selectively attenuate the high-frequency noise while preserving the sinusoidal component. Here's an example using a Butterworth filter:
main.m336 chars13 lines
In the above code, we first calculate the normalized cut-off frequency by dividing the desired cut-off frequency by half of the sampling frequency. Then, we design a low-pass Butterworth filter using the butter
function. Finally, we apply the filter to the signal using the filtfilt
function, which performs zero-phase filtering.
The filtered_signal
will contain the sinusoidal component with the AWGN filtered out.
Note: The order and cut-off frequency values used in the filter design should be chosen based on your specific requirements.
gistlibby LogSnag