LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compute "period" of rectangle signal

I have input rectangle signal with noise. Period T < 10 seconds.

 

I need to compute dynamically how long time highest and lowest vaues.

 

Signal changes from highest to lowest and from lowest to highest value immediatelly(<0,05 sec).

 

0 Kudos
Message 1 of 3
(2,288 Views)

Code in C-style language:

 

x(t) - square-formed function

 

x0 - treshold value

 

t_beg_min = t_cur;

t_beg_max = t_cur;

FindMax = true;

FindMin = false;

if ((x_cur>x0) and FindMax)  {

  Time_min = t_cur - t_beg_min; ->OUTPUT

  t_beg_max = t_cur;

FindMax = false;

FindMin =  true;

}

 

if ((x_cur<x0) and FindMin)  {

  Time_max = t_cur - t_beg_may; ->OUTPUT

  t_beg_min = t_cur;

 

FindMax = true;

FindMin = false;

 

}

 

 

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

I found solution:

 

http://www.labviewforum.de/index.php?showtopic=976&hl=Timingmessung

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