02-19-2015 09:16 AM
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
Solved! Go to Solution.
02-19-2015 09:20 AM
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…
02-19-2015 03:25 PM
02-20-2015 01:40 AM
02-20-2015 04:24 AM
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
02-20-2015 05:45 AM
04-10-2015 05:32 AM
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
04-10-2015 09:38 PM
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
04-14-2015 12:12 AM - edited 04-14-2015 12:15 AM
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)...