フィルターのクリア

How do I resample my data?

3 ビュー (過去 30 日間)
Veerle Kohlen
Veerle Kohlen 2021 年 1 月 7 日
コメント済み: Veerle Kohlen 2021 年 1 月 8 日
Hi,
I am looking for a method to standardise exercise duration. I measured core temperature during 60 minutes of exercise. However, due to exhaustion not all participants were able to complete the experiment. For those participants I want to resample the data, so that all participants have an equal sample number in the exercise phase. I have tried interp1, which works. However, I want to interpolate inbetween the temperatures I measured. So that the final temperature I measured, stays the final temperature measurement.
Does anyone have suggestions?
Cheers!

採用された回答

Image Analyst
Image Analyst 2021 年 1 月 7 日
If the final time point in your query x (time) vector is the same, then the final temperature will be the same. If it's not, then attach your data and code to prove otherwise.
  3 件のコメント
Image Analyst
Image Analyst 2021 年 1 月 7 日
I think you're looking for something like this, where the original data has 51 samples, but the resampled data has 60 samples, and the first and last points are the same.
s1 = load('nw2_temperature.mat')
s2 = load('nw2_time.mat')
% Get vectors from the mat files.
esophageal.nw2.Exercise.Temperature = s1.T;
times = s2.T;
% Put temperatures into a variable called "V".
V = esophageal.nw2.Exercise.Temperature;
V = V(:); % Convert to column vector.
% Get time vector starting at 0 instead of whatever they really start with.
times = times - times(1);
plot(times, V, 'b.-');
grid on;
hold on;
% Make 60 query times between 0 and the final time.
tQuery = linspace(times(1), times(end), 60);
y = interp1(times, esophageal.nw2.Exercise.Temperature, tQuery, 'spline');
plot(tQuery, y, 'r.-');
legend('V', 'y', 'location', 'north');
Veerle Kohlen
Veerle Kohlen 2021 年 1 月 8 日
Thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by