LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find particular points from a waveform data

Hi everyone,

I'm new in this forum and I'm a mechatronic engineer. I'm currently working on a project:

given a set of points acquired from a continuous waveform (NI9205 module), I need to find programmatically two points per period (point 1 and 2 in photo). The waveform is acquired from a diode switching ON and OFF periodically.

The points I need to find are the one in the image (1 and 2):

 

IMG_0572.JPG

Attached there the zip file containing my VI (some constants will depends on sampling frequency and ON/OFF timings) and the data to be analyzed.

I appreciate any kind of help.

 

Regards,
GP

0 Kudos
Message 1 of 15
(4,377 Views)

Hi Gio,

 

calculate the derivation of the voltage waveform, then check for larger steps in the derived signal…

 

Unfortunately you forgot to mention the noise in your signal, making it harder to use a simple derivation:

check.png

Apply a filter on your noisy signal…

 

Also you should define the difference between points 2 and 3 (or clearly define how to detect them):

check.png

Which index is point 2 and which index is point 3?

 

One more idea: to get rid of the noise filtering you might simply use a threshold detector: whenever the signal crosses above/below the 0.70 threshold you are very near to one of your points 1, 2, or 3…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 15
(4,363 Views)

Thank you for you kind and fast reply.

I don't know if you have a look at my VI but this is basically what I'm doing. I applied a 3rd order filter and the waveform became smooth. The I apply the derivative. The problem is that I can find the first point because I have an inversion of the derivative but I cannot find the second point because there is just a slope change in the derivative.
Any other suggestions?

GP

0 Kudos
Message 3 of 15
(4,357 Views)

Hi Gio,

 


@Gio1993 wrote:
I don't know if you have a look at my VI but …
Any other suggestions?

Right now I'm stuck to LV2017 so I cannot look at your VI.

For suggestions see my edited post above…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(4,345 Views)

Thank you again.

 

Find the index of points I'm searching for would solve my problem.

There is no problem with filtering, as I said, I can obtain a quite smooth waveform using the filter vi.

Points I'm interested are 1 and 2 in picture from 1st post.  There is no need of threshold because I can use sampling time from the DAQ and the ON OFF times in order to detect the range of data points to search for my point.

I'll explain in a better way:

If my DAQ acquires at 1 kHz and the diode stays ON for 2 minute and OFF for 2 minutes, then I know that my 1st point will be around the 120000th sample and the second around the 240000th sample.

A simple routine to detect whenever first identified point is the 1st or the 2nd I'm searching for has been implemented in the proposed VI.

0 Kudos
Message 5 of 15
(4,332 Views)

Hi Gio,

 


@Gio1993 wrote:

If my DAQ acquires at 1 kHz and the diode stays ON for 2 minute and OFF for 2 minutes, then I know that my 1st point will be around the 120000th sample and the second around the 240000th sample.

A simple routine to detect whenever first identified point is the 1st or the 2nd I'm searching for has been implemented in the proposed VI.


Then use the threshold approach:

IF sample(t-1) < threshold AND sample(t) >= threshold THEN ON
IF sample(t-1) >= threshold AND sample(t) < threshold THEN OFF

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 15
(4,310 Views)

Thank you for the proposed approach but the threshold solution is not the best in my opinion.

I think that the best way to solve my problem is to use an approach that works on waveform pattern:

the threshold may be varying and the wave form will be always the same (independently from wave values). 

I've been working and now I'm able to find point 1 and 3 from first post pic.

 

It remains only the routine to identify precisely the 2nd point, the one that has no derivative sign inversion. Do you think the only possible solution is to use a threshold? What about such threshold depending on sampling frequency? How do you solve such dependency?

 

Regards,

GP

0 Kudos
Message 7 of 15
(4,264 Views)

@Gio1993  ha scritto:

It remains only the routine to identify precisely the 2nd point, the one that has no derivative sign inversion. Do you think the only possible solution is to use a threshold? What about such threshold depending on sampling frequency? How do you solve such dependency?

 

Regards,

GP


If you solved the other points by derivative analysis cannot you investigate on higher degree derivations (I don't know English terminology, I'm sorry). Try to analyse the derivation of the derivation and so on until you cannot detect you interesting points

0 Kudos
Message 8 of 15
(4,257 Views)

Here is my try 😉

remove mean, detect zero crossings , slice the wfrm, fit a polynom (migth be better ones) , get the endpoints

getpoints.png

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 9 of 15
(4,251 Views)

Sorry if I took so much time to answer but I used this time to understand the last VI idea. It apparently solved my problem and it works on different datasets with same wave pattern. The only thing I don't understand is why sometimes the VI misses points. Thank you very much for your effort, it was a really good starting point.

 

Regards.

0 Kudos
Message 10 of 15
(4,205 Views)