03-11-2012 04:19 PM
I have a number of files and each file contains two columns: X1, Y1; X2, Y2; X3,Y3; etc.
These files are just bell shaped curves where the peaks happen at different X values (in other words, the peaks are shifted).
I would like to generate one file with X1, Y1, Y2, Y3, etc. such that the maximum Y from each file is at the same location as X1.
The idea is to shift these curves so that they all lie on top of each other as much as possible. The attached Excel sheet shows what I want.
How can I do this?
Solved! Go to Solution.
03-11-2012 04:25 PM
Hello Murchak,
Have you already written a piece of code?
One easy way to start would be to work with the Array Max & min function (http://zone.ni.com/reference/en-XX/help/371361H-01/glang/array_max_and_min/).
Based on the resulting indexes you can then "shift" the array.
03-11-2012 04:31 PM
Thank you ThiCop.
Yes I have written a code for the first part of the problem. Basically, I am using the first file as the baseline curve, and the subsequent files need to be normalized to the baseline curve.
My VI does that so far. Next is the do the shifting.
So your idea is to find the row index of max Y1, and row index of max Y2, etc, and shift the arrays by the difference between these row indexes? I will try that and see where I get with that.
Thanks,
03-12-2012 03:24 PM
Hello murchak,
If you have any questions or get stuck somewhere, then don't hesitate to post some code and let us help you.
03-13-2012 01:28 PM
Hi,
Thanks for the suggestion. I got it worked out!