フィルターのクリア

How to remove the AWGN noise from data?

21 ビュー (過去 30 日間)
Sadiq Akbar
Sadiq Akbar 2022 年 9 月 29 日
コメント済み: Sadiq Akbar 2022 年 10 月 4 日
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.,
U=awgn(Uo,30);
Now we see that U and Uo are different. We want to get back our original data Uo. I tried as:
Uo=U-awgn(30);
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?

回答 (2 件)

Chunru
Chunru 2022 年 9 月 30 日
Uo=[20 30 40 50]; % signal
U=awgn(Uo,30) % add noise to signal
U = 1×4
19.9837 29.9773 40.0475 50.0504
% Uo=U-awgn(30);
% 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")
  2 件のコメント
Sadiq Akbar
Sadiq Akbar 2022 年 9 月 30 日
Thanks a lot dear Chunru for your kind response. Actually I want to get back my my original vector Uo if not exactly then aprroximately equal.I don't need the plot. In your piece of code, you have used a low pass filter. But I don't know why did you use it? 2ndly you have not get back the original Uo. Can you do some filtering so that we can get exactly or approximately Uo. 3rdly my original vector consists of only four values but you have taken 81 values i.e., Uo = [20:1:100]/30; Why is this?
Chunru
Chunru 2022 年 9 月 30 日
The plot is for u to see how good the filtered result as an approximation. You can always comment it out when you are satisfied the results.
For filter to work. You need sufficient data. If you have only 4 points, you may not be able to do much with the added noise.

サインインしてコメントする。


Star Strider
Star Strider 2022 年 9 月 30 日
I would simply use a moving average filter, for example movmean, or choose one of the options in smoothdata, to eliminate normally-distributed additive noise.
  15 件のコメント
Star Strider
Star Strider 2022 年 10 月 3 日
My pleasure!
It is likely not possible to completely recover a signal that has had Gaussian white noise added to it.
Experiment with the sgolayfilt function and wdenoise (wavelet denoising) function. Those are likely the best options.
Sadiq Akbar
Sadiq Akbar 2022 年 10 月 4 日
Thanks a lot for your kind response dear Star Strider. Can you demonstrate it here as I am not too much expert in Matlab?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by