Interpolating unequally spaced data

Hey,
I have an excel file containing the data of a propeller showing u,v,w velocities wrt arrival time. But the data collected is unequally spaced. I would like to interpolate the whole data and have tried pchip for it but for some reason doesnt get the result. Can someone help me with this. I have attached the excel sheet for reference.
Thank you in advance

 Respuesta aceptada

Star Strider
Star Strider el 29 de Jul. de 2019
Use the Signal Processing Toolbox resample function:
[D,S] = xlsread('Vinf9P12RPM2981K0I0B0V2.000001.xls','Group 2');
Fs = 1/0.4;
[D79,tr] = resample(D(:,7:9),D(:,2),Fs);
figure
plot(D(:,2), D(:,7:9), '+-')
grid
xlim([10 30])
title('Original Signal')
legend(S(7:9), 'Location','SE')
figure
plot(tr, D79, '+-')
grid
xlim([10 30])
title('Resampled Signal')
legend(S(7:9), 'Location','SE')
The original signal has a mean sampling frequency of 0.4063 s (median 0.3413 s) with a standard deviation of 0.2965 s.
This resamples it to a sampling interval of 0.4 s and a sampling frequency of 2.5 Hz.

4 comentarios

Anisha Varughese
Anisha Varughese el 29 de Jul. de 2019
Hey,
Thank you so much. It gave me the results I wanted. Can you help me do the same thing for a workbook with multiple sheets. I tried using this code but it gives an error for some reason. Thanks again
Star Strider
Star Strider el 29 de Jul. de 2019
My pleasure.
Your ‘workbook with multiple sheets’ would have to read and resample each sheet separately. If you do that in a loop, you will need to save the results in a cell array for each sheet. Also, you may need to change the column references if the columns are not the same on the other sheets.
With respect to the error, please copy all the red Error text from your Command Window and paste it to a Comment here. I have no idea what the error is otherwise, or how it might be resolved.
If my Answer helped you solve your problem, please Accept it!
Anisha Varughese
Anisha Varughese el 29 de Jul. de 2019
Thanks
Star Strider
Star Strider el 29 de Jul. de 2019
As always, my pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 29 de Jul. de 2019

Comentada:

el 29 de Jul. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by