LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make a threshold for a DAQ board.

I have two analog signal inputs (pulse trains from a DAQ board) that is
stored in a 2D array. I split this array off into the two channels, each a
1D array. What I need to be able to do is create a minimum threshold point
that will separate the noise from the actual pulses. The pulse must reach a
certain value before it is considered valid and passed on the a histogram
function. All valid pulses must be passed on to the histogram and the time
interval between pulses must be able to be calculated. I have tried using
the greater than or equal to comparison function, but when I connect the 1D
array to the input, the Boolean output wire (to a case structure) goes bad.
Why? I have been trying to use a case structure a
fter the comparison
function. Is this the right method?
0 Kudos
Message 1 of 3
(2,476 Views)
Remove NS in address to reply wrote:

> I have two analog signal inputs (pulse trains from a DAQ board) that is
> stored in a 2D array. I split this array off into the two channels, each a
> 1D array. What I need to be able to do is create a minimum threshold point
> that will separate the noise from the actual pulses. The pulse must reach a
> certain value before it is considered valid and passed on the a histogram
> function. All valid pulses must be passed on to the histogram and the time
> interval between pulses must be able to be calculated. I have tried using
> the greater than or equal to comparison function, but when I connect the 1D
> array to the input, the Boolean output wire (to a case structure) goes bad.
> Why? I have been trying to use a case struct
ure after the comparison
> function. Is this the right method?

It appears you probably have 2 different problems.
If you want to use a 1D array then you have to compare against a 1D array
and the Boolean output will also be a 1D array.

You have to have as many items in the comparison array as are in the data
array
and the boolean array will have an equal number of items.

My suggestion is to put the whole comparison function and the case structure
inside a for loop. Let the for loop auto index (so it can take any amout of
data items.)

At the edge of the for loop you can build the array for the histogram.

This can get a bit tricky because the output will have to have the same number

of items as the input array. In the false case send out a NAN.

If you send this to a graph or chart the NANs will not display. If you know
the time
between the samples you can then calculate the times since the NAN will hold
the places.

Note that if you are doing binning there is a slightly differen
t procedure.

Kevin Kent
0 Kudos
Message 2 of 3
(2,476 Views)
"Kevin B. Kent" wrote in message
news:39D93020.D8137246@mail.usa.alcatel.com...
> Remove NS in address to reply wrote:
>
> > I have two analog signal inputs (pulse trains from a DAQ board) that is
> > stored in a 2D array. I split this array off into the two channels, each
a
> > 1D array. What I need to be able to do is create a minimum threshold
point
> > that will separate the noise from the actual pulses. The pulse must
reach a
> > certain value before it is considered valid and passed on the a
histogram
> > function. All valid pulses must be passed on to the histogram and the
time
> > interval between pulses must be able to be calculated. I have tried
using
> > the greater than or equal to comparison function, but when I connect the
1D
> > array to the input, the Boolean output wire (to a case structure) goes
bad.
> > Why? I have been trying to use a case structure after the comparison
> > function. Is this the right method?
>
> It appears you probably have 2 different problems.
> If you want to use a 1D array then you have to compare against a 1D array
> and the Boolean output will also be a 1D array.
>
> You have to have as many items in the comparison array as are in the data
> array and the boolean array will have an equal number of items.

Actually, you can compare an array with a single number, but the output is a
boolean array. The problem here is only the inability of the subsequent case
structure to deal with this, thus the broken wire.

What is the histogram you are trying to make?
I assume "probability" vs. "interval between pulses"?

How clean is the data? e.g. is each pulse exactly one position in the array,
or could it be longer?

Simplest:
Just compare your array with the threshold and do the analysis on the
resulting boolean array. A would be a pulse if you compare the way
you just tried.

Feed it into an autoindexing for loop, then...
(Option 1) Use a shift register initialized with an empty array, and for eac
h append an element consisting of the number of preceding .
Then use the histogram function.

(Option 2) Initialize the shift register with a reasonably sized array. For
each true use the number of preceding as index for the array element
to increment by one. -> instant histogram.

If you have "extra-long" pulses you should ignore gaps of zero, e.g.
consider all following another to before analysis).

Scale X-axis according to your timebase.

If this is not quite clear, I can probably wire up a demo in a few minutes.
Let me know.

Cheers
Christian
0 Kudos
Message 3 of 3
(2,476 Views)