LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use of Integration VI

Solved!
Go to solution

I think my problem is solved but let me finish off my section of the programming which involves this then I'll update you as to whether this was my final solution Thank you

0 Kudos
Message 11 of 21
(218 Views)

@LED47 wrote:

I need a graph of the running interval for all points


Try attached subVI. For one-shot computation, set reset = True.

 

So, you have options...

Please do share back when you are finished with your code updates. And if you don't mind me being nosy, what are you integrating (CORR_SPEC_MULT) with respect to what (WL)? My brain hasn't yet figured out the physical meaning of this math. 

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 12 of 21
(197 Views)

I am including photo-diode response to an optical power measurement...

 see attached

Message 13 of 21
(171 Views)

Your x axis is "almost" linear with just a slight curvature and it would simplify things dramatically if you would just resample the Y data for a reasonable constant dx using interpolation.

0 Kudos
Message 14 of 21
(158 Views)

I'm wondering if could impose on you to have a look at my basic starting point.

I'm certainly not sure I'm applying the integral function correctly.

 

In this program I output initially the raw spectrum as it comes from the spectrometer.

I then multiply the raw spectrum by the responsivity of the power detector.

The output from the spectrometer is from 350 nanometers to 1000 nanometers in incremental steps of approximately .2 nanometer.

I felt one way to do this would be to simply expand the manufacturer's responsivity to match the number of array points in my spectrometer output.

I didn't do any interpolation 

 

Any help you could get me would be greatly appreciated...

Download All
0 Kudos
Message 15 of 21
(150 Views)

I think it makes more sense to linearly interpolate the manufacturer's responsivity than to expand the array.

dsbNI_1-1765945139354.png

 

dsbNI_2-1765945187319.png

 

I added the integral of the unevenly spaced data for comparison. Integrating the uneven data appears to give a final integral value more than 15% greater than the integral of the linearized wavelength.

Given these observations, I offer these suggestions:
1. Interpolate the manual responsivity

2. Integrate the spectrum at the acquired (uneven) wavelengths

3. Don't confuse wavelength and time

   - Evaluate whether you need to scale wavelength (from nm to m) before computing integral

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 16 of 21
(110 Views)
Solution
Accepted by topic author LED47

Note that interpolation works most easily using an array of xy points. Also note that since the x values are now spaced equally, all we need is a plain waveform graph. You can set x0,dx via property node or more easily using a special cluster as shown {x0, dx, [Y]}.

 

Here's what I might do:

 

altenbach_0-1765958044065.png

 

0 Kudos
Message 17 of 21
(88 Views)

@Altenbach, great tip to interpolate XY data! Also, by resampling the acquired spectrum, you were able to close accuracy gap to within 0.013 %. Accuracy continues to improve as you decrease step in wavelength (i.e. from 0.19265 to 0.01 or finer).

dsbNI_0-1765982980975.png

 

dsbNI_1-1765982993557.png

 

@LED47: I recommend path 3 because it requires one less assumption (wavelength spacing to get required accuracy).

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 18 of 21
(46 Views)

That's very generous of you thank you very much...

 

Obviously it would have been quite some time before I was able to come up with that on my own.

 

Using this as a model for future development as far as the integral goes and interpolation I think we'll be very helpful to me.

Thank you Chris

0 Kudos
Message 19 of 21
(34 Views)

Thank you very much that's very informative...

0 Kudos
Message 20 of 21
(32 Views)