NI Labs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Please suggest code to find the time period of the process as shown in image.

Please suggest code to find the time period of the process as shown in image.

or any example from which i can have idea.

time in numeric indicator - Copy.png

Regards

MMS79

Regards
mms79
0 Kudos
Message 1 of 3
(3,522 Views)

See the Pulse and Transition Measurements analysis functions and example code.

http://www.ni.com/example/30782/en/

http://zone.ni.com/reference/en-XX/help/371361K-01/lvwave/transition_measurements/

Also, for analyzing a transfer function or state-space model, there are functions in the NI Control Design & Simulation Toolkit.

http://zone.ni.com/reference/en-XX/help/371894G-01/lvctrldsgn/parametric_time_response/

0 Kudos
Message 2 of 3
(2,934 Views)

A simplistic approach would be to low-pass filter both signals. Differentiate, and look for a threshold crossing that signifies a level change. You can subtract the indices of the threshold crossings and convert from samples to time to get td. After the first threshold crossing, threshold for a small value in the differentiated PV signal (i.e., where the slope returns to zero) to find the index of the "end" of the change. Find the Y values for both of these points to get the total change in PV and multiply by .63 and add that to the initial. Now use that value to threshold the raw (or filtered) PV signal to get that index. Again, subtract the indicies and convert to time; now you have tau.

YMMV. You may not need to filter (or even differentiate) the process signal; it just depends how clean and consistent it is.

Good luck!

0 Kudos
Message 3 of 3
(2,934 Views)