12-15-2025 10:56 AM
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
12-15-2025 04:08 PM - edited 12-15-2025 04:20 PM
@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.
12-16-2025 08:18 AM
I am including photo-diode response to an optical power measurement...
see attached
12-16-2025 09:20 AM
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.
12-16-2025 11:00 AM
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...
12-16-2025 10:27 PM - edited 12-16-2025 10:34 PM
I think it makes more sense to linearly interpolate the manufacturer's responsivity than to expand the array.
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
12-17-2025 01:57 AM
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:
12-17-2025 08:52 AM - edited 12-17-2025 08:54 AM
@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).
@LED47: I recommend path 3 because it requires one less assumption (wavelength spacing to get required accuracy).
12-17-2025 10:08 AM
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
12-17-2025 10:09 AM
Thank you very much that's very informative...