フィルターのクリア

How can I create an idealized cycle from quasiperiodic data?

3 ビュー (過去 30 日間)
Samuel Harvey
Samuel Harvey 2021 年 8 月 11 日
コメント済み: Star Strider 2021 年 8 月 30 日
I have data of blood velocity (attached) over several cardiac cycles. I'm trying to create a single idealized cycle that takes into account the natural variations in duration and velocity from cycle to cycle, while removing the noise. This is what the data looks like at the moment:
The standard way I've done it in the past is to manually pick points over a single cycle, then interpolate them. The blue interpolated line is roughly what I'm looking for as an output.
Is there any way I can create this kind of idealized cycle from the data I have?

採用された回答

Star Strider
Star Strider 2021 年 8 月 11 日
This is called ‘ensemble averaging’. See for example Combining repetitive curves into one average curve and similar posts.
Try this —
LD = load('normalized_velocities.mat');
norm_values = LD.norm_values;
t = 1:numel(norm_values);
plocs = find(islocalmax(norm_values, 'MinProminence',0.1));
plocs = [plocs numel(t)];
vlocs = find(islocalmin(norm_values, 'MinProminence',0.005));
for k = 1:numel(plocs)-1
ixm(k) = max(vlocs(vlocs<plocs(k))); % Min Before Peak
end
% for k = 1:numel(ixm)-1
% ix{k} = ixm(k):ixm(k+1);
% pulse{k} = norm_values(ix{k});
% n(k) = numel(ix{k});
% end
for k = 1:numel(ixm)-1
ix{k} = plocs(k)-11:ixm(k+1);
pulse{k} = norm_values(ix{k});
n(k) = numel(ix{k});
end
ens = zeros(1,max(n)); % Preallocate
for k = 1:numel(pulse)
ens(k,1:n(k)) = pulse{k}(1:n(k));
end
ensavg = mean(ens,'omitnan');
figure
plot(t, norm_values,'.-')
hold on
plot(t(plocs), norm_values(plocs), '^r')
plot(t(vlocs), norm_values(vlocs), 'vg')
hold off
grid
figure
plot((0:max(n)-1), ens, '.-')
grid
figure
plot((0:max(n)-1), ensavg)
grid
producing:
Experiment to get the result you want.
.
  7 件のコメント
Samuel Harvey
Samuel Harvey 2021 年 8 月 30 日
Sorry, let me clarify. The issue with using zeros for placeholders is that at the tail end of the cycle those zeros are being treated as data points and affecting the average. Each curve is a slightly different length, so at the tail end it ends up averaging values from the longer curves with the zeros instead of only using existing data points. You can see in your figure that the idealized cycle drops off sharply at the very end, but that goes away when NaN values are used.
Star Strider
Star Strider 2021 年 8 月 30 日
O.K.
The initial ‘ens’ vector is created to correspond to the maximum length of the discovered waveform segments, so it should be no longer than the longest one.
.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGaussian Process Regression についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by