# How to get discrete values from a nosiy data set that have a trend?

I have a sensor that produces values over time (appr. 50/sec). I visualized these values (X axis is the time), this can be seen on the picture, measurement A and B - these are two independent measurements.

I'm a total beginner, I don't even know how to phrase the question. I just need to get... I don't know... "discrete" (?) values from this noisy data set.

I need something like this (this is happening say under 10 seconds):

Up... Up... Up... Up - I'm only interested in the "ups".

I was thinking of summarizing the values and when it's positive that's an up and when it's negative that's a down. But I don't know where to start and until when do I have to summarize the values...

or if is there (I'm sure there is) any other methodology that is used for this kind of problems.

UPDATE:

After talking with Dan Boschen and applying what he recommended (moving average), I got lot smoother result:

Still got difficulties to ignore the false movements, but this is a one-step-forward. I'll continue this topic in a different question.

• Well for starters it looks like you want to set y to 0 whenever y < 0 (is it that simple?). Also what are you actually interested in- the complete positive waveform as you have circled, or one data point from each interval? Or possibly the rate of each? It would help if you added some details as to your purpose with the results and the big picture of what you are trying to do and why. Commented Dec 23, 2019 at 22:07
• Unfortunately it's not that simple, because under the circled area you can see some negative values too. I don't want to differentiate between ups and downs based on when it's going negative from positive and positive from negative, that would be too easy. By the way this is a cell phone's gyroscope and I'm doing some biological work with them. Commented Dec 23, 2019 at 23:12
• To answer your question: I need to get somehow the 'intervals' you mentioned. Or the rate. So if I can tell how many 'ups' there are under 10 seconds that would be perfect. Commented Dec 23, 2019 at 23:15
• Ok- so you'll want to filter, a simple moving average will reveal the trend but the more you know about the signal of interest the better you can filter. Are you counting ups or do you need more information beyond number of general ups? OK we crossed threads, I see your answer now. Commented Dec 23, 2019 at 23:16