LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Signal Algorithm help

I have two signals.  

 

Signal 1: 0-5V trigger signal.  During the time duration of interest, the trigger will go high 4 times for 1ms each.  In my software, I need to find the last trigger, which I can do easily.

 

Signal 2: From about 0 to 30ms, the signal is noise with level +- 40mV.  From about 30ms and up, the signal is noise with level +-5mV.  

 

I am suposed to find the time dfference between when the last trigger of signal 1 occurs and when signal 2 becomes +-5mV. 

 

I tried to do this by flipping the two signal arrays and find the elements in the arrays where specified thresheds are crossed.  Of course, the threshold for signal one is dffierent than signal 2.  The described approach only works 50% of the times.  The method fails when ignal 2 has spikes during the +-5mV period, which occurs once in a while.  

 

Any inputs on algorithm?  Thanks!  See attached for a pictorial explaination

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 4
(2,300 Views)

Attached is my attempt at the problem.  I introduced a guard band on my search.  I only ran a few test cases, and I will try it out tomorrow.  If you have better ideas, let me know.  Thanks!

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 2 of 4
(2,284 Views)

Jyang,

 

Is there an acceptable absolute maximum for the noise around +/- 5mV. As long as the values stays below that absolute maximum for X number of readings. If you are just measuring noise, there really isn't a guarantee that your timing won't be off. What if you have a section of noise in your specificed section of 40mV area that stays under the threshold? Later on it swings back up to 40mV. It could be considered a false reading. So you would need to do a running history of how many readings in the threshold area are acceptable.

Kyle Hartley
Senior Embedded Software Engineer

Message 3 of 4
(2,258 Views)

The high section and low sections are pretty consistant.  Only the short duration spikes at th low section can cause a problem.  However, I designed in a guard band to get around that.  If I find a high, I make sure that the next high is very close by.  If now, it is only a spike.  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 4 of 4
(2,222 Views)