Borrar filtros
Borrar filtros

How can I create an idealized cycle from quasiperiodic data?

3 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

Star Strider
Star Strider el 11 de Ag. de 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 comentarios
Samuel Harvey
Samuel Harvey el 30 de Ag. de 2021
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 el 30 de Ag. de 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.
.

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by