Splitting 200sec of ECG data into single waveforms
Show older comments
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)
Wayne King
on 11 May 2012
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
Freddrick Burton
on 11 May 2012
Categories
Find more on ECG / EKG in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!