Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

finding patterns in array data

I have an array of analog data representing data packet pulse widths of a signal. I want to search this array to find the packet start which is a a series of pulses of specific widths. If I simply use the threshold vi it will sometimes work but it really only compares the difference between each two samples. At a minimum I would need to specify a min,max for a series of 3 pulses.


0 Kudos
Message 1 of 6
(4,052 Views)
I meant to say using Labview 8.0. In any procedural language this kind of thing is trivial.
0 Kudos
Message 2 of 6
(4,048 Views)
Hey tadk,

I would be glad to help you out, but it would really help if I had an example set of data.  It sounds like you need to search through the array using a while loop and see if the current value fits into the min/max range.  In any case a VI with the analog data saved in an array or just a small list of values and the search characteristics would be very helpful.  This sounds like more of a LabVIEW rather than a DIO question so in the future I might recommend posting to the LabVIEW section.  In any case I will be glad to see what I can do with that sample data.

Please let me know!
Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 3 of 6
(4,038 Views)

Right now I collect an array containing 500 doubles.  The pattern I am looking in the data begins with 12 consecutive elements with values of 0.0025 plus or minus 10% followed by a single element with value 0.005 plus or minus 10%. The elements captured before and after this pattern could have any values but tend to be in the range 0.0 to 0.020 and are pretty random. As long as I was able to locate at least 3 consecutive values of 0.0025 followed by one value of 0.005 that would be good enough. If I locate a pattern which matches these constraints, the test passes.



0 Kudos
Message 4 of 6
(4,035 Views)
tadk,

Since you would like to use a tolerance, this becomes a little more complex.  Here is a possible solution.  I check to see if the current value is within a range, and if so it passes a true to a shift register.  I use two elements in the shift register so I can detect if I have two elements of 0.0025, and if so I check to see if the next value is in the 0.005 range.  If this pattern is found I set a Boolean true and exit the program.  You could expand the number of matches by increasing the number of shift registers and compound arithmetic.  Please let me know if this is approximately what you were trying to do.

Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 5 of 6
(4,023 Views)
It looks like it might work - I'll let you know.
0 Kudos
Message 6 of 6
(4,017 Views)