How to remove the AWGN noise from data?
17 views (last 30 days)
Let's say we have a vector data Uo=[20 30 40 50];
If we add AWGN noise to it, it becomes data U i.e.,
Now we see that U and Uo are different. We want to get back our original data Uo. I tried as:
But it gives error as:
Error using awgn (line 63)
Not enough input arguments.
What commands should I use to get back my vector Uo?
Chunru on 30 Sep 2022
Uo=[20 30 40 50]; % signal
U=awgn(Uo,30) % add noise to signal
% if you don't know the noise (which is U-Uo), you are not able to fully
% recover the signal.
% However, it is possible to "filter" out noise if signal and noise are
% different in certain characteristics.
% For your case, signal is a low-pass signal and lowpass filter can help to
% remove some noise.
Uo = [20:1:100]/30;
U = awgn(Uo, 10);
b = fir1(20, 0.02); % low pass filter
Ufiltered = filtfilt(b, 1, U);
t = 0:length(Uo)-1;
plot(t, Uo, 'r', t, U, 'b', t, Ufiltered, 'k')
legend("Signal", "Signal+noise", "Filtered")