whati's solution for signal filtering ?

Hi :) I'd like to know how to filter this signal in figure, can you give the solution ?
Thank's

2 commentaires

Jan
Jan le 30 Jan 2023
It depends on what you consider as noise and what as signal. Maybe you want to get rid of the low frequencies, or the high ones. Maybe you want a band only, or exclude it. The readers cannot guess this detail.
Mathieu NOE
Mathieu NOE le 30 Jan 2023
and also it's quite usefull to share the data and some code if you have started one

Connectez-vous pour commenter.

Réponses (1)

Sarvesh Kale
Sarvesh Kale le 31 Jan 2023
I have made the assumption that the data around time 100 and 350 is error data that you would like to get rid of, I suggest the following steps
  1. subtract 400.2 from samples of data as noise data is having a mean of approximately 400.2, this will make noise data centered around 0
  2. perform FIR filtering such that it will smoothen the data, FIR filter to be used can be 0.2*[1 1 1 1 1], FIR filtering can be done using simple convolution operation
  3. Add the bias component back to the signal samples
Following is the code that achieves the above.
% assume data is X
X = X - 400.2 ;
f = 0.2*[ 1 1 1 1 1] ;
filtered = conv(X,f) ;
filtered = filtered + 400.2 ;
plot(filtered) ;
OR
Alternately, there is also an option of Clean Data under Home tab of MATLAB.
Import your data and select the smooth function from the App.

3 commentaires

Jan
Jan le 31 Jan 2023
Modifié(e) : Jan le 31 Jan 2023
Subtracting the estimated mean (why not calculating it?) reduces the transient effects at the margins only. If the initial and final signal differ, this is a weak approach.
With conv('same') a time shift is avoided. Using movmean instead offers a better handling of the margins, but the same values at the inside, without the need for assumptions about the DC level of the signal:
X = rand(1, 30) + 1000;
Y = conv(X, [0.2, 0.2, 0.2, 0.2, 0.2], 'same');
Z = movmean(X, 5);
plot(X, 'r'); hold('on');
plot(Y, 'b');
plot(Z, 'ok')
ylim([999, 1002])
But the main problem remains, that the OP did not clarify, what the noise and what the signal is. The blocks at X=100 and 350 look such similar, that they might be the searched signal.
Sarvesh Kale
Sarvesh Kale le 31 Jan 2023
Thank you for your inputs on mean calculation @Jan
Guendouz walid
Guendouz walid le 31 Jan 2023
thank you

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by