Jump to content

Find a valley in continuous DAQ data


Recommended Posts

I'm just looking for something to spark something in me to get me going in the right direction. I need to find a valley that occurs just before a 150 mV rise in the signal. After that I need acquire data for several more seconds. The signal before the valley will be slowly falling and the rise after the valley will be somewhat sharper. There is no absolute value I can look for - just the valley.

I figured I'd need to continuously sample the DAQ channel and then grab fixed chunks of the buffer and examine the buffer. The problem with that approach is that I might grab a portion of the signal that contains the valley but not the full 150 mV rise. In which case I would miss it.

Any ideas would be welcome.

George

Link to comment

Tim has the right idea, you want to create a circular buffer to hold the data. If you know approximately how long the event is, it makes life eaiser. Say you are looking for an event that is 1 second long. Grab data out of the DAQ buffer in 250 ms chunks. Allocate an array of chunks that is 2 seconds long, or 8 chunks. As you grab each new chunk, rotate the array and replace the end element with the new chunk. This has the effect of discarding your oldest chunk. Concatate the array into one continuous waveform and look for your valley.

You'll have to tune your chunk size and array length to your application.

Link to comment

I'm just looking for something to spark something in me to get me going in the right direction. I need to find a valley that occurs just before a 150 mV rise in the signal. After that I need acquire data for several more seconds. The signal before the valley will be slowly falling and the rise after the valley will be somewhat sharper. There is no absolute value I can look for - just the valley.

I figured I'd need to continuously sample the DAQ channel and then grab fixed chunks of the buffer and examine the buffer. The problem with that approach is that I might grab a portion of the signal that contains the valley but not the full 150 mV rise. In which case I would miss it.

Any ideas would be welcome.

George

If you can define the trough as a rising, falling edge or it drops below a certain level, you can get the analogue card to trigger aquisition. Take a look at

Acq&Graph Voltage-Int Clk-Analog Start w Hyst.vi in the examples and see if it will suffice.

Link to comment

If you can define the trough as a rising, falling edge or it drops below a certain level, you can get the analogue card to trigger aquisition. Take a look at

Acq&Graph Voltage-Int Clk-Analog Start w Hyst.vi in the examples and see if it will suffice.

I'd still need an absolute level for this to work. I can't be certain of an absolute level. All I know is that there is a trough followed by a rise of 150 mV.

George

Link to comment

I'd still need an absolute level for this to work. I can't be certain of an absolute level. All I know is that there is a trough followed by a rise of 150 mV.

George

Using Tim's and Eric's Ideas use a circular buffer.

So you are going to have an array of points X of dimension N

As each new chunk comes in do the following test.

Find the minimum point xi

Is (x0 - xi) > Dip Threshold

Is (xn - xi) > 150mV

Is (xn - x0) > Difference Threshold

If all are true then acquire for the desired number of seconds.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.