Hi I have the following data recorded with 15Hz and I want to resample it using linear interpolation to 25 Hz. What is the best way to achieve this? Here is the first second of my data set:
RecordFile YTSIMTMD RBDDLO_0 RBDDGS_0 IDLWMWC1 time timeNF
864 2C01MUC.txx 85535.10 -0.31 -0.348873 1 0.00000 0
865 2C01MUC.txx 85535.17 -0.31 -0.348873 1 0.06667 6667
866 2C01MUC.txx 85535.23 -0.31 -0.348873 0 0.13334 13334
867 2C01MUC.txx 85535.30 -0.31 -0.348832 0 0.20000 20000
868 2C01MUC.txx 85535.37 -0.31 -0.348832 0 0.26667 26667
869 2C01MUC.txx 85535.43 -0.31 -0.348832 0 0.33334 33334
870 2C01MUC.txx 85535.50 -0.31 -0.348832 1 0.40000 40000
871 2C01MUC.txx 85535.57 -0.31 -0.348796 1 0.46667 46667
872 2C01MUC.txx 85535.63 -0.31 -0.348796 1 0.53334 53334
873 2C01MUC.txx 85535.70 -0.31 -0.348796 1 0.60000 60000
874 2C01MUC.txx 85535.77 -0.31 -0.348796 0 0.66667 66667
875 2C01MUC.txx 85535.83 -0.31 -0.348767 0 0.73334 73334
876 2C01MUC.txx 85535.90 -0.31 -0.348767 0 0.80000 80000
877 2C01MUC.txx 85535.97 -0.31 -0.348767 0 0.86667 86667
878 2C01MUC.txx 85536.03 -0.31 -0.348767 1 0.93334 93334
879 2C01MUC.txx 85536.10 -0.31 -0.348735 1 1.00000 100000
After that I want to match it with this data set recorded with 25 Hz
vpName vpID origIndex areaNum areaName startMS endMS durationMS startF endF durationF accumIndex
1 2C01 1 1 2 ATT 0 560 560 0 14 14 1
2 2C01 1 1 2 ATT 0 560 560 0 14 14 1
3 2C01 1 1 2 ATT 0 560 560 0 14 14 1
4 2C01 1 1 2 ATT 0 560 560 0 14 14 1
5 2C01 1 1 2 ATT 0 560 560 0 14 14 1
6 2C01 1 1 2 ATT 0 560 560 0 14 14 1
I found that approx
seems to be the linear interpolation for linear interpolation in R, however I am not sure which parameters to use to upsample my data from 15 to 25 Hz?
There seem to be explicit packages for handling time series in R like zoo and xts, but I am not sure whether I need them. Both data sets start at the same time, so after upsampling I could simply match by rownumber.
Thank your for your help!