How to chop up/segment a periodic signal?

10 次查看(过去 30 天)
I have a normal EKG signal (a periodic signal), and I 'd like to automatically chop up the signal into individual cycles (containing the P, QRS, and T waves). Could somebody please tell me how I can do that? I don't know the length of each cycle; should I calculate these precisely? Getting an approximate cycle length using autocorrelation would be good enough? The .mat file is attached.
Many thanks in advance!

采纳的回答

Star Strider
Star Strider 2022-9-7
This approach takes advantage of the fact that the Q-T interval in a normal EKG is less than one-half the previous R-R interval.
This will work for an EKG displaying regular sinus rhythm, however it might not work for atrial fibrillation (that would not then have an indentifable P-wave anyway).
LD = load(websave('ECG','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1119640/ECG.mat'))
LD = struct with fields:
ECG: [524798×1 double]
ECG = LD.ECG;
Fs = 1024;
L = numel(ECG);
t = linspace(0, L-1, L)/Fs;
[pks,locs] = findpeaks(ECG, 'MinPeakProminence',0.5)
pks = 684×1
2.5451 2.1133 1.7806 1.5151 1.2995 1.1442 1.0095 0.9103 0.8269 0.7568
locs = 684×1
251 1019 1787 2554 3323 4091 4858 5627 6394 7162
figure
plot(t, ECG)
hold on
plot(t(locs), pks, '^r')
hold off
grid
xlim([20 22.5])
for k = 1:numel(pks)-2
RR = (locs(k+1) - locs(k));
idxrng = locs(k+1) + (-fix(RR/2) : fix(RR/2));
ECGp{k} = ECG(idxrng);
end
figure
subplot(3,1,1)
plot(ECGp{20})
grid
title('Complex 20')
subplot(3,1,2)
plot(ECGp{100})
grid
title('Complex 100')
subplot(3,1,3)
plot(ECGp{200})
grid
title('Complex 200')
You could also use these to generate an ensemble average.
.
  23 个评论
Susan
Susan 2022-11-29
Thank you so very much again for your help! You gave me enough hints to work on other signals and figure out a way to eliminate unwanted spikes.
Yes, these records are actual records in a noisy scenario to measure an instrument's tolerance to the environment and are not artificially corrupted.
Star Strider
Star Strider 2022-11-29
As always, my pleasure!
I now get the impression that the intent here is to develop the instrumentation, and the EKG records are not the actual objective.
.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Applications 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by