Sampling and resampling data of different lengths
Mostrar comentarios más antiguos
Hi,
I have two sets of data, one from a motion analysis software (Vicon) which is captured at 100Hz and another set of data from a IMU called motion sense. The trouble I am having is when I plot the data against each other for a comparison study they do not match up. The motionsense software is sampled at about 50Hz, however, there are slight variations with in the data of 0.02 second. Making the sample rate 49.8 at times. I want both the vicon and motionsense to start and finish at the same time, but showing all the data.
So if they are at different frequencies I obvsiouly can't just cut them after 100 data points as I lose alot of data.
Currently if I say I want 0.5 seconds of data to display for each then I will have 2 lines on a graph of different lengths.
Is there a way to get the sample rates the same and constant within the file without losing any data as well as ensuring the data sets start and finish at the same time.
I am trying to get the 50Hz sampling constant for the motionsense data set so that I know I can match both graphs up.
The 67CT_log is the data from the motion sense- The time stamps are in the spreadsheet fore reference.
Vicon has a time stamp for each cell starting from 1,2,3,4,ect,ect
The graph I am getting out is as seen in the attachment.
Both graphs should link up as they are recording the same movements at the same time just on different devices.
Any help would be great.
Thank you
6 comentarios
Mathieu NOE
el 18 de Jun. de 2021
hello Alexandra
do we really have a problem here ? I thought first that the major problem was plotting two sets of data with one being not truly sampled at fixed rate (motionsense ) , but this is not a plotting issue as if you plot two sets of data together, one can be sampled at one fixed rate while the second can have irregular time stamps and both lines can perfectly overlay ; it's just that the time stamps (either regular or not must) truly match acquisition sampling time stamps;
now looking at the two curves in your figure it seems to see that they are simply time shifted about 0.5 s (looking at the time delta of positive and negative peaks , this is everywhere the same delta) but this may be due to the fact that the two records starts / stops are not synchronized - time duration are also different

beside that, I don't understand how to interpret the time stamps in the csv file as the delta between two consecutive values is either 658 or 659 , in which units ? relation to 50 Hz rate is not obvious to me
all the best
alexandra ligeti
el 19 de Jun. de 2021
Mathieu NOE
el 21 de Jun. de 2021
hello Alexandra
do you have a code (+data) on which I could work to help you ?
tx
alexandra ligeti
el 22 de Jun. de 2021
Mathieu NOE
el 23 de Jun. de 2021
hello Alexandra
seems to me that I need also the "static" measurements files - according to what I undertstand so far in your code :
%% Find angle between static reference vector and changing dynamic vector
% Angle between static and slow dynamic
%Sine Rule
SinTheta_1 = cross(unit_Static_4,unit_Dynamic_vec_4);
Theta_1 = 180.*(asin(SinTheta_1))./pi;
alexandra ligeti
el 23 de Jun. de 2021
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!