Compute and plot error of data at different sampling rate

Hello,
I’m running into a issue where I have two sets of data that describe the same system but at different sample rates, for example moving from 0 to 5:
A=[012345] B=[0 3 5]
I hope to compute the error between the two set of data over time and so far the answers I found online is using linspace to plot the two data sets so they match up but I am wondering if there is a way to find the error between the two data.
I thought about doing interpolation but apparently seems like only integers is allowed not double. Maybe I am doing it wrong.
More context: the higher sample rate data is a trajectory sent to the robot and the lower sample rate data is the actual position of the joint. These values are all doubles, the number of trajectory data points is 10 point something (not integer) more than the actual position data points. I want to plot the error to figure out the control error. Using linspace I can line up the two plots really, but I can’t find a way to compute the error.
Any suggestion is appreciated, thank you!

2 comentarios

KSSV
KSSV el 29 de Jun. de 2020
I thought about doing interpolation but apparently seems like only integers is allowed not double.
No interpolation is allowed in double.
You can do interpolation to your problem and get them to the same dimensions and proceed with error.
Are both signals sampled at a constant sampling rate? It seems that between 0 to 3, there are three samples for signal A and between 3 to 5, there are two samples. If they are sampled at a variable rate, do you have the time-stamp corresponding to each sample?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Interpolation en Centro de ayuda y File Exchange.

Preguntada:

el 29 de Jun. de 2020

Comentada:

el 29 de Jun. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by