Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

USB DAQ continuous analog input find peak to peak amplitude

Solved!
Go to solution
I need to know if there is a way to use the peak detector when doing a continuous analog voltage input. I'm using 8.6 and VS2005 C#.
0 Kudos
Message 1 of 4
(4,039 Views)
Solution
Accepted by topic author jsheridan

Hi jsheridan,

 

 Have you looked at the peak detector example that comes with Measurement Studio?  The example for C# can be found here: C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS2005\DotNET\Examples\Analysis\PeakDetector\cs  (assuming you installed to your C: drive).

 

The example generates a waveform and uses the PeakDetector class to detect the peaks.  You can take this example and modify it to support what you are doing, or just put some of the functions into your code.  The Detect function takes in an array and outputs arrays of the locations, amplitudes and second derivatives of the peaks and valleys in the array passed to it.  If you want to use this continuously, you could just do a peak detection after every few reads or every few seconds so that you're not doing a lot of unnecessary computations.

Eric B.
National Instruments
0 Kudos
Message 2 of 4
(4,019 Views)

Thanks Eric,

 

I have that working now. Another question arises. I'm grabbing a continuous sample of voltages from a pressure sensor and passing it through a bandpass filter Then I pass it through the DSP.SignalProceesing.PulseParameters then I PlotY to a waveformgraph. The project is an oscillometric blood pressure machine The question is the waveform when sensing the pressure creates an waveform envelope I need to capture the beginning and end of the envelope any suggestions would be greatly appreciated. Thanks John

0 Kudos
Message 3 of 4
(4,007 Views)

I'm glad that was helpful.

 

As for your new question, I'm not sure what you mean by the beginning and end of the waveform envelope.  I know you can find the envelope in LabVIEW (example here) by running a Hilbert Transform (which is available in Measurement Studio in NationalInstruments.Analysis.Dsp.Transforms.FastHilbert) then plotting |x(t) + i*h(t)|, where x(t) is the original data and h(t) is the hilbert transform.

Eric B.
National Instruments
0 Kudos
Message 4 of 4
(3,989 Views)