How can I create an idealized cycle from quasiperiodic data?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Samuel Harvey
il 11 Ago 2021
Commentato: Star Strider
il 30 Ago 2021
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?
0 Commenti
Risposta accettata
Star Strider
il 11 Ago 2021
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 Commenti
Star Strider
il 30 Ago 2021
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.
.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!