加速度・角速度計にて​複数回計測したデータ​を平均し新たな行列を​作成

7 views (last 30 days)
daiki naito
daiki naito on 6 Mar 2022
Edited: daiki naito on 10 Mar 2022
加速度・角速度計にて1人の被験者から3回計測したデータを加算平均し、1つのデータにまとめる方法について教えていただきたいです。
データの形は経過時間、各軸の加速度、各軸の角速度が行列となっております。また各測定の経過時間は均一ではないため、3回のデータともに行数が違っております。
このような3つのサイズのことなる行列を平均し、経過時間を統一させた各軸の加速度・角速度の行列を求めたいです。
  2 Comments
Hernia Baby
Hernia Baby on 7 Mar 2022
ここでいうデータというのは時系列データでしょうか?
(データは [t, Ax, Ay, Az, Rx, Ry, Rz] みたいな感じですか?)
その場合は開始条件と終了条件が同じであるか教えてください。
daiki naito
daiki naito on 7 Mar 2022
データの形はそのような形の時系列データです。 開始条件、終了条件はありますが、時系列データの長さが揃っていません。

Sign in to comment.

Answers (2)

Hernia Baby
Hernia Baby on 7 Mar 2022
サイズの異なる時系列データとのことで以下のように作ってみました。
まずは刻みが異なる波を用意します
clear,clc;
Fs = 1e3;
t = (0:1/Fs:.5)';
Fs2 = 1e2;
t2 = (0:1/Fs2:.5)';
A = 5;
f1 = 10;
x = A*sin(2*pi*f1*t);
x2 = A*cos(2*pi*f1*t2);
fprintf('x-size: %g\nx2-size: %g',height(x),height(x2))
x-size: 501 x2-size: 51
interp1 を用いて内装補間を基にリサンプルします
x2_fit = interp1(t2,x2,t);
plot(t,x,t,x2_fit,'--',t2,x2,'ok')
legend({'x','x_{2fit}','x_2'},'Location','northeastoutside')
平均は2つのベクトルを連結させて mean をとります
y = mean([x,x2_fit],2);
figure
plot(t,x,'--',t,x2_fit,'--',t,y,'k')
legend({'x','x_{2fit}','x_{mean}'},'Location','northeastoutside')

daiki naito
daiki naito on 7 Mar 2022
ありがとうございます。
ご教示いただいた方法を参考にさせていただきます。

Categories

Find more on データの前処理 in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!