08-16-2022 02:27 AM - edited 08-16-2022 02:29 AM
i have a 1 dimensional array and i display it on a graph. The problem here I want to find the anomaly on this chart (because normally the chart will be stable for a while, when there is an outlier it will greatly fluctuate like the video I attached below.
Can anyone give me some advice on how to solve this problem.
thank
link video: https://www.youtube.com/watch?v=ClBmxvXMNWo
08-16-2022 02:33 AM
Hi Vu,
@Vu_Anh wrote:
i have a 1 dimensional array and i display it on a graph. The problem here I want to find the anomaly on this chart
The question is worded wrongly: you don't find changes "in a chart", but you detect anomalies on your data!
So: you need to define an algorithm to detect those "unusual data", then you can easily filter them.
Some of those "unusual data" look like there was "no data" at all from your DAQ device, so you better try to fix the upstream code where those data is read from DAQ device…
08-16-2022 12:59 PM
Normally you want to get to the root cause of the anomaly and fix it instead of trying to hide it.
Example - holes in the data:
Wrong: Whenever I see a hole in the data, I will fill it with zeros.
Right: I should discover why there are holes in the data and fix it so there are no longer holes in the data.
08-16-2022 08:15 PM - edited 08-16-2022 08:25 PM
@GerdW wrote:
Hi Vu,
@Vu_Anh wrote:
i have a 1 dimensional array and i display it on a graph. The problem here I want to find the anomaly on this chart
The question is worded wrongly: you don't find changes "in a chart", but you detect anomalies on your data!
So: you need to define an algorithm to detect those "unusual data", then you can easily filter them.
Some of those "unusual data" look like there was "no data" at all from your DAQ device, so you better try to fix the upstream code where those data is read from DAQ device…
Sorry my English is not good, so the interpretation is difficult to understand. What I mean here is that my data is displayed on a chart to make it easier for you to observe and find outliers. That anomaly was created by me and i want to detect it in software.
I want to find an algorithm that can find that outlier in real time.
I tried using the function "array max min" to find the 2 largest and smallest values. Then subtract 2 results to find fluctuations but it is correct only when my data is stable.
08-16-2022 08:18 PM
@billko wrote:
Normally you want to get to the root cause of the anomaly and fix it instead of trying to hide it.
Example - holes in the data:
Wrong: Whenever I see a hole in the data, I will fill it with zeros.
Right: I should discover why there are holes in the data and fix it so there are no longer holes in the data.
How to find holes in data? This data hole was created by me and I want to detect them in the software to execute the trigger.
08-17-2022 11:05 AM
Oh!!! You're simulating a failure and you want to detect it! I have to think on this - that was unexpected. Thank you for the clarification.
08-17-2022 11:38 AM
Hi Vu,
@Vu_Anh wrote:
How to find holes in data? This data hole was created by me and I want to detect them in the software to execute the trigger.
Apart from understanding your approach to this by generating the faulty data on your own:
A simple approach might be to detect for sudden "jumps" in your signal by calculating the derivate and checking for large derivate sample values…
08-17-2022 08:57 PM
@billko wrote:
Oh!!! You're simulating a failure and you want to detect it! I have to think on this - that was unexpected. Thank you for the clarification.
Because my data it's stable in one state. Thank you for your help, I look forward to hearing from you.
08-17-2022 09:55 PM
@GerdW wrote:
Hi Vu,
@Vu_Anh wrote:
How to find holes in data? This data hole was created by me and I want to detect them in the software to execute the trigger.Apart from understanding your approach to this by generating the faulty data on your own:
A simple approach might be to detect for sudden "jumps" in your signal by calculating the derivate and checking for large derivate sample values…
can you tell more about calculating the derivate and checking for large derivate sample values
08-18-2022 12:50 AM
Hi Vu,
@Vu_Anh wrote:
can you tell more about calculating the derivate and checking for large derivate sample values
Did you learn some basic math at school?
Derivative is defined as dx/dt, so you calculate the difference between one sample and the next, then multiply by your sample rate (which is the same as 1/dt)…
You really ask "how to check for large values"? Ever looked at the comparison functions palette?