george seifert Posted September 29, 2009 Report Share Posted September 29, 2009 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 Quote Link to comment
Tim_S Posted September 29, 2009 Report Share Posted September 29, 2009 I expect you're looking to use a circular buffer to hold the last N seconds of data. You'd perform the analysis on the buffer which would include the last data acquired. Quote Link to comment
george seifert Posted September 29, 2009 Author Report Share Posted September 29, 2009 I expect you're looking to use a circular buffer to hold the last N seconds of data. You'd perform the analysis on the buffer which would include the last data acquired. Right, but reread my second paragraph. Analyzing the buffer and the timing of when I grab the buffer is the issue. George Quote Link to comment
EricLarsen Posted September 29, 2009 Report Share Posted September 29, 2009 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. Quote Link to comment
ShaunR Posted September 29, 2009 Report Share Posted September 29, 2009 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. Quote Link to comment
george seifert Posted September 29, 2009 Author Report Share Posted September 29, 2009 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 Quote Link to comment
ShaunR Posted September 29, 2009 Report Share Posted September 29, 2009 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 Your absolute level is the mean of the previous (say 100) datapoints. Quote Link to comment
Kurt Friday Posted September 30, 2009 Report Share Posted September 30, 2009 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. Quote Link to comment
george seifert Posted October 1, 2009 Author Report Share Posted October 1, 2009 Thanks for all the suggestions. Been busy with other stuff. I need some time to digest the suggestions. George Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.