LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

shifting arrays

Hallo,

I have two arrays containing data vor two curves. They are of the same kind, there is only a little offset between them. With "find peak" I can calculate the only valley of the diagram. I need to "shift" the arrays so that the peaks are overlapping.

How can I do that? My tries with deleting parts of the first array and adding zeros to the other failed.

(Example: Take two sin-functions, sin(x) and sin(x+1) over one period. The offset is -1; how can I remove it?)

Arno
0 Kudos
Message 1 of 2
(2,614 Views)
When you say "shift the arrays", are you trying to just graph them in sync or are you really willing to loose data (or pad with bogus data) to get them to both be in sync? If you are merely trying to graph them together, build them into waveforms and adjust the x0 of one of them, then graph them together. It may take some playing with it to get the exact adjustment figured out.

If you are willing to loose data and make the arrays align, you can do the same as above but then run the waveforms through the Align and Resample Express VI (Express -> Signal Manipulation -> Align and Resample) and align the data. This can be set to adjust data by stripping data until the x0 (t0?) and data length match.
0 Kudos
Message 2 of 2
(2,614 Views)