フィルターのクリア

How to synchronise two time series data with different sampling time in MATLAB?

14 ビュー (過去 30 日間)
Arshey Dhangekar
Arshey Dhangekar 2021 年 10 月 2 日
コメント済み: Mathieu NOE 2021 年 11 月 5 日
There are two sensor measured power and temperature and they have 4 mintutes sampling time difference. I want to synchronise time of power and temperature sensor data. How can I synchrnoise in csv data file? it because around 9440 obeservation the time difference between two devices become 10 minutes which created problem graph plotted. how can I use interp1 to sychnronise two different time data?
interp1(x,v,xq)

回答 (1 件)

Mathieu NOE
Mathieu NOE 2021 年 10 月 4 日
hello
see my suggeston below
the new common time vector is sampled with only N = 100 here , but you can adjust this to your own needs
clc
clearvars
T =readtable('sample file.xlsx','Format','auto');% Sr no_Temperature_sensor Sr no_Power_sensor Time_Temperature_sensor Time_Power_sensor
Time_Temperature_sensor = str2double(T.Time_Temperature_sensor);
Time_Power_sensor = str2double (T.Time_Power_sensor);
Temperature_sensor = T.SrNo_Temperature_sensor;
Power_sensor = T.SrNo_Power_sensor;
% common time vector
common_time_min = max(min(Time_Temperature_sensor),min(Time_Power_sensor));
common_time_max = min(max(Time_Temperature_sensor),max(Time_Power_sensor));
N = 100;
common_time_vector = linspace(common_time_min,common_time_max,N);
% interpolate both data sets on common time vector
Temperature_sensor2 = interp1(Time_Temperature_sensor,Temperature_sensor,common_time_vector);
Power_sensor2 = interp1(Time_Power_sensor,Power_sensor,common_time_vector);
figure
plot(common_time_vector,Temperature_sensor2,common_time_vector,Power_sensor2);
  3 件のコメント
Mathieu NOE
Mathieu NOE 2021 年 10 月 25 日
hello again
problem solved ?
Mathieu NOE
Mathieu NOE 2021 年 11 月 5 日
hello
do you mind accepting my answer ?
tx

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by