LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous boxcar averaging between cursors

Hi all, 

 

I have taken some recent successes with LV and am trying to write a VI which will take a continuous boxcar average of an input waveform where I specify the area of averaging between two (or four, etc.) vertical cursors.  

 

Just some background: the experiment I run is IR photodissociation of a molecule, where we monitor the production of the photofragment relative to the parent molecule.  I currently use an old school SR250 boxcar integrator and delay generator to monitor the production (peak area) of the photofragment as a function of photon energy to generate an IR spectrum.  I am taking small steps in writing new modern code to do this so we can get rid of our ancient LeCroy o-scopes and QuikBasic code.

 

My idea is to sample the waveform from the instrument, display the waveform in my VI, drag two x-axis cursors to bracket a peak, then take the sub-array between those to use in the boxcar averager I wrote.  The output from the boxcar can then be used in whatever fashion I'd like.  I have included a VI using s simulated sine wave, with the output array being displayed on screen.  I cannot seem to make this VI (or any attempts using a live signal) display both a continuous signal and only output the average in the output array. 

 

Any suggestiions are appreciated.  Thanks!

0 Kudos
Message 1 of 6
(3,315 Views)

 I cannot seem to make this VI (or any attempts using a live signal) display both a continuous signal and only output the average in the output array. 

I'm a bit confused - do you want to place cursors while you're acquiring a signal?  Will these cursors be "set" as the signal "passes through" them? Or do you want to manually select only certain peaks?

 

I'm not sure if it will be helpful because I'm not sure exactly what your question is, but did you look at this other post? It's just more info about a boxcar averaging in labview.

Ashley G.
Senior Applications Engineer | RF & Wireless Communications
0 Kudos
Message 2 of 6
(3,240 Views)

Hi Ashly, 

 

Thanks for the response.  Maybe I can be more clear.  You are correct - I want to place cursors while the signal is aquired.  These cursors will be "set" as the signal "passes through" them.  The way my experiemnt works is that I use a laser to find a photofragment, which appears as a small peak on the o-scope trace next to the parent peak.  This small peak only appears when the laser is in resonance with a transition of the parent molecule causing photodetachment.  The idea is to bracket this small peak with the two cursors (which will be found ahead of time), then have the only the sub-array bracketed by those cursors be monitored as a function of laser frequency.  

 

We do this now with an antiquated SRS250 boxcar averager and an old LeCroy o-scope but are trying to move to the future!  Any other hints and suggestions are appreciated.  

0 Kudos
Message 3 of 6
(3,224 Views)

I think you want a property node for the graph inside the event structure. Then you can get the positions, not the indexes, of both cursors and use the information to extract the data subset. The Event Data Node only returns data about the cursor which triggered the event.  You can use shift registers but it seems simpler to just grab all the data from the property node.

 

Lynn

 

Cursor.png

0 Kudos
Message 4 of 6
(3,206 Views)

Also, a simple for loop or Ramp.vi will generate your X array. All three sets of code in this image produce the same result.

 

Lynn

 

3 ways.png 

0 Kudos
Message 5 of 6
(3,200 Views)

Hi Lynn, 

 

Thanks for the suggestions.  I have sa question about your last point.  I am still having difficulty making a continuous singal using any of the three ideas you suggested  Each appears to give me a single waveform, and it works fine.  I tried doing some loops to get it to continuously simulate the sine wave anfd Gaussian white noise but no dice. Any suggestions?  Thanks!

 

 

 

 

Joe

0 Kudos
Message 6 of 6
(3,179 Views)