LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I compute the amplitude of an entire analog voltage stream?

For all intents and purposes, I am an beginner/ameteur LabVIEW programmer.

I am calibrating a hydrophone, and so have tried to create a VI that will input an analog voltage signal when I tell it to start, and stop inputting when I tell it to stop.  I'd like to be able to see the data as it comes in, and for it to be able to measure the amplitude(or retrieve the min and max value) over the entire signal stream (from start to stop) after it has collected all the data. The signal will essentially look like a sine wave.  I have tried several different configurations, and one of the main problems has been that any amplitude measuring/min max getting VI will not look at the entire set of data, it will only address the most recent samples in order to calculate the amplitude. What is the best way to read the entire data stream without changing the number of samples in the 'daq assistant express VI'?

I am inputting data through a scb-68 shielded connector block and then into a 6062e pcmcia card.

0 Kudos
Message 1 of 5
(3,005 Views)

Hi,

Try this

Keep saving the the data from start to stop in a file using suitable file writing functions

since u seem to be working with daq assistant, start with something simple like 'write waveforms to file.vi' found in in functions tools palette waveform-> waveforms file i/o select append to file option as true in this vi.

after stop, use the vi i have attached to read the waveform, get the voltage array and find min, max and the amplitude which you want to measure

hope this helps

regards

dev

Message 2 of 5
(2,983 Views)

Hi Emily,

   Having read devchander's (excellent) idea, it almost seems imprudent to post another.  Disk-storage sounds like a good idea - unlimited post-processing opportunity!  Still the shift-register idea (below) is pretty simple, and the history-buffer might work for you as well...

1) It sounds like there's a loop running, and array max/min is returning values for segments of data.  Use "shift register"s to hold the current max and min.  After calculating max for the current segment compare them to the max/min of previous iteration.  See pic.

2) For "smaller" data-sets, a Strip Chart might be a nice way to both, observe the data as it comes in, and collect the data for final max/min calc.  As data is added to the Strip Chart, it's appended to a "History" buffer (it's just an array) which can be examined any time.  You'll probably need to increase the length of the Chart's history-buffer, which is fixed at run-time.  Multiply DAQ frequency (Hz) by max-expected-duration (sec) to get max expected samples.  Right-click on the chart and select "Chart History Length" to set the value.  Of course available computer RAM will be a consideration.  Assuming your AtoD is 24-bit or less, use SGL data-type! (SGLs are 4-byte floats.)

Message Edited by Dynamik on 11-18-2005 12:20 AM

When they give imbeciles handicap-parking, I won't have so far to walk!
Message 3 of 5
(2,980 Views)

Hi Dynamik,

Thank you for your compliment!

Your even your solution is superlative.

Emily, hope this discussions have answered your query

regards

Dev

 

 

 

Message 4 of 5
(2,953 Views)
Thank you both so much for your help. 

I understand the gist of your both your proposed solutions, and have been able to implement a variation on devchander's answer. This will have to do for the time being, as I'm on somewhat of a deadline, however, I plan to play around with Dynamik's shift register idea when I get a bit more time.

I'm psyched to keep learning how to do more with this huge and powerful program. Thanks again.
0 Kudos
Message 5 of 5
(2,929 Views)