LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I normalise range on x-axis on graph to 0-100% cycle time?

Solved!
Go to solution

Hi everyone,

 

I have small problem hopefully someone can help with me... I have a number of 1D files with data sampled at the same rate (0.067Hz or 1 sample every 15 s); but the files lengths are different due to longer/shorter recordings (range of 188 to 233 data points in each file)...

 

How can I normalise these files so the x-axis is in units of % duration (i.e. 0-100%).. I assume I will need to interpolate each file by a different factor to provide a common file size (e.g 300 data points); then resample down by a factor of 3 (or the like)..?

 

Having troubling doing this... Nothing seems to work?

 

Any suggestions appreciated.

 

Thanks.

Jack

0 Kudos
Message 1 of 9
(3,876 Views)

Hi Jack,

 

different approaches:

- use a XY graph. Scale the x values (your "duration") for each file/plot, to fit your 0…100% range…

- use a waveform graph. Put your files/plots in waveforms and change the dt of the waveform to fit your x axis range…

- interpolation/resampling might be a solution too…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,873 Views)
Hi GerdW,

Thanks reply... One file for example has 3120 data points sampled at 0.067Hz (15 s samples)... While another file has 2870 data points.

Would it be possible to provide me with an example of one of those methods??... I tried all these and could not get any to work.. Mainly focused on the interpolate and resample approach.


Thanks.
0 Kudos
Message 3 of 9
(3,850 Views)
Solution
Accepted by topic author jcannon

Hi J,

 

like this:

check.png

Both graphs will show both plots over the x range of 0…1!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 9
(3,833 Views)

Thanks G..

 

Do I need the for loops with the auto index, or can I input data direct from "Read from spreadsheet.vi"? I assume the for loops are just to provide a dummy data session.

 

Also, I assume no prob with changing 0-1 range to 0-100?

 

Thanks again... Will try this later tonight...

 

Jack

0 Kudos
Message 5 of 9
(3,823 Views)

Hi Jim,

 

your assumptions or ok… 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(3,812 Views)

Hi GerdW,

 

I went with the build waveform graph option using the reciprocol of the array size... All working... Many thanks for your help!

 

Regards,

Jack

0 Kudos
Message 7 of 9
(3,677 Views)

Hi GerdW,

 

Ok... Looks like I may have jumped the gun here... I actually need to save the data to file with an array lenght of 100 data points... So although the methods above will graph the data set with a common x axis range of 0 to 1 units, the number of data points in the signal is unchanged (data set lengths range from 180-400 data points).

 

How can I down sample (or nomalise)  signals back to a common length of 100 data points?

 

Any suggestions would be very much appreciated... As always, I will post my working code when the problem is solved.

 

Thanks,

Jack

0 Kudos
Message 8 of 9
(3,651 Views)

Alright... So the Resample and Align express vi was more simple that I thought.... Wire in your signal and wire in the desired dt and you are good to go (where dt is the raw signal length divided by the desired resampled signal length)...

 

 

0 Kudos
Message 9 of 9
(3,610 Views)