Splitting 200sec of ECG data into single waveforms

I have 200 seconds of ECG data which i have event markers for. I need to split it evenly across the event marker so i have many single ECG signals, and average them so i have a single ECG. Following this i need to do a moving average. Anyone help. My MATLAB skills are none existent?

Answers (1)

You need to reshape them into a matrix and then average. When you say event markers, are you saying that you know which belong to which epoch?
Suppose you have data sampled at 100 Hz. Suppose the event markers are every 10 seconds.
N = 200*100;
% just creating some junk data
x = randn(N,1);
x1 = reshape(x,1000,20);
ts = mean(x1,2);
ts is your averaged data of length 10 seconds. Then you can just a moving average filter on that
ts = filter(0.1*ones(10,1),1,ts);
If you have the Signal Processing Toolbox, you can also use buffer() which allows you to overlap the buffers.

1 Comment

The event markers mark the peak of the QRS complex. there are 282 event markers and the smallest amount of data points between is 1253. I need to split the signal so that i have 282 cycles with 626 data points each side of the event marker (so i have 282 ECG cycles all the same length). then collate the signals together so i just have one.

Sign in to comment.

Categories

Asked:

on 11 May 2012

Community Treasure Hunt

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

Start Hunting!