How can I plot an ECG txt file for analysis on Matlab?

8 ビュー (過去 30 日間)
Katrina Anderson
Katrina Anderson 2020 年 11 月 10 日
コメント済み: Star Strider 2020 年 11 月 13 日
I have an ECG file in txt format (.txt) and I was hoping to plot it using Matlab.
I have attached the file.
Thankyou for any help and advice.

採用された回答

Star Strider
Star Strider 2020 年 11 月 10 日
First, read it and assign the variables:
D = readmatrix('ECG_10.11.20_11.57.59.txt', 'HeaderLines',6);
EKG = -D(:,1); % EKG Trace (mV)
t = D(:,2)*1E-3; % Time Vector (s)
There are a lot of noise and other problems with that signal, so it is going to require a significant amount of processing. It is not regularly-sampled, so the Signal Processing Toolbox resample function will be necessary to assign it to a consistent sampling interval before further processing. (I would resample it to a sampling frequency of 130 Hz.) Note that the leads were apparently reversed, the resons for negating the EKG signal.
I leave all that to you.
  2 件のコメント
Katrina Anderson
Katrina Anderson 2020 年 11 月 13 日
awesome thankyou!!
Very helpful indeed :)
Star Strider
Star Strider 2020 年 11 月 13 日
As always, my pleasure!
I very much appreciate your compliment!

サインインしてコメントする。

その他の回答 (1 件)

Mathieu NOE
Mathieu NOE 2020 年 11 月 10 日
hello
if you work with a recent release of matlab, there are plenty of solutions... but not all are fast. usually the "modern" function can do very nice on complex formatted files, but the price is it's slow
you can try :
and
but if you just need something simple , fast for simple files , I really enjoy the readclm function - see attached files
it will gives you the header txt and the data , and it's fast !
>> head
head =
HEADER START
USER:
DATE/TIME: 10.11.20 11.57.59
DEVICE_ID: 7B5F7922 DEVICE_VERSION: 3.0.56 APP_VERSION: 1.2.0
CHANNELS:ECG MS
HEADER END
all the best
  1 件のコメント
Katrina Anderson
Katrina Anderson 2020 年 11 月 13 日
thankyou! i will look into this also as I have just downloaded the new version :) appreciate your help

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeECG / EKG についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by