How to chop up/segment a periodic signal?

6 ビュー (過去 30 日間)
Susan
Susan 2022 年 9 月 7 日
コメント済み: Star Strider 2022 年 11 月 29 日
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 Center および File ExchangeApplications についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by