LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the time at which zero crossing point happen using zero crossing vi

Solved!
Go to solution

Hi 🙂 
Im trying to find the inflection point's time of a Bio-Signal by having the the 2nd derivative of it , then detecet the zero-crossing point of the derived signal 
What i need is to mark the inflection point on my Bio-Signal by the time at which the derived signal crosses the zero .
Capture.PNG

0 Kudos
Message 1 of 14
(5,929 Views)

You posted in the "signal conditioning" forum, but it seems more like a programming question.

What software are you using? (e.g. LabVIEW, etc.)

Can you show us your code with some typical data?

0 Kudos
Message 2 of 14
(5,925 Views)

Thank you Yes im using Labview

Download All
0 Kudos
Message 3 of 14
(5,908 Views)

We also need some data. Please post a typical data file, preferably a small one.  If the Forums will not let you post a file with the .tdms suffix, enclose it in a zip file.

 

Lynn

0 Kudos
Message 4 of 14
(5,870 Views)

Here is a sample of data 

0 Kudos
Message 5 of 14
(5,855 Views)

Here is a sample of data im working on

0 Kudos
Message 6 of 14
(5,851 Views)

I like to use the Savitsky-Golay filter for smoothing and differentiation.  When I apply that to your data it seems to work well at finding the inflection points.

 

I read your file and saved the data as a constant.  To use data from other files enable the other case of the Diagram Disable structure.

 

I do not have the wavelet addon but standard VIs will do everything you need.

 

Detrend => Subtract Mean. 

 

Smoothing and differentiation => Savitsky-Golay. See the detailed help file for the Savitsky-Golay VIs for information on how to get derivatives.

 

Find negative-going zero crossings: Compare 2nd derivative to zero and use Implies to locate the zero crossings. 

 

Lynn

 

Inflection.png

Download All
0 Kudos
Message 7 of 14
(5,812 Views)

Ooops!!!  There is a bug in the VI I posted earlier.

 

I wired the wrong coefficients into the differentiation section.  Here are corrected VIs.

 

You may need to adjust the number of side points to work well with the noise levels of your signals.  Some of the signals such as around t = 240 may not have well defined points.

 

Also note that this finds inflection points on both rising and falling parts of the signal.  If you only want the falling parts, just add another test to check the signal levels either side of the inflection point.

 

Lynn

 

Inflection 2.png

Download All
0 Kudos
Message 8 of 14
(5,795 Views)

Thank you from the bottom of my heart 
but i think you posted the same Vi you have posted before
would you check it again 🙂 

0 Kudos
Message 9 of 14
(5,759 Views)
Solution
Accepted by laythzraiqat

The second one has two scales on the graph, one on each side.  The first one had only one scale. I did not change the VI name so both have the same name.

 

Lynn

0 Kudos
Message 10 of 14
(5,746 Views)