I am facing a challenge and wanted to ask for your suggestions.
I am coding in c/c++ and I have an array like below.
A[40]={0,0,1,0,2,7,18,45,80,85,88,91,88,65,12,3,0,1,0,2,1,2,5,45,88,89,78,79,65,12,5,2,1,0,0,1,0,0,1}
As you can see, there are 2 rises that we can also call them curves.
This array stores the value of a real-time signal respect to the time.It works like a queue and refresh itself for every new value.
I want to detect and count the rises, I’ve tried some methods so far but couldn’t figure out a consistent solution yet.
My question is: how can I detect these curves and tell that there are 2 curves in array A?
Do you know any good way to detect them coherently? Or is there a method or something to handle this kind of signal works?
I really need the answer to advance on my project so all your answers are welcome. Thanks in advance.
You can spot peaks in your data by looking for the points where the sign flips when comparing neighbouring values:
Note that you actually have more than two peaks in your data:
If they’re not really peaks (just noise in the data) then you could fix that in a few of ways: