Matlab: Eliminating Freak Values ​​in a Dataset

I am looking for a method to eliminate freak values ​​from a given dataset. For instance:

Filter Dataset

All these peaks must be eliminated. I tried different filters like medfilt , but the peaks are still there. I also tried the low pass filter, but it didn't work either. I am new to signal filtering, so I probably did it wrong.

You can download datasets for x array here and y here .

I could also imagine a loop for comparing values ​​next to each other, but am I sure there should be an inline function?

Here is the result using medfilt1(input,15) :

filtered signal

The peaks disappear, but then I get these ugly steps that I don't want.

+5
source share
1 answer

just use the middle filter! medfilt1(data,3) will do if it is a 1-pixel "space" burst. If the peaks remain, increase the window size to 5 or more ...

EDIT: this is what the operational data looks like:

enter image description here Thus, we see that the data is not exactly uniform or ordered, and there are a lot of data points in the spikes, in contrast to what is clear from the question at first (guys, please build your data correctly!) The question is whether the data is in spikes or baseline?

+7
source

Source: https://habr.com/ru/post/1238412/


All Articles