Filter löschen
Filter löschen

How to debug Error in Pan Tompkins?

2 Ansichten (letzte 30 Tage)
Shraddha Joshi
Shraddha Joshi am 14 Apr. 2016
Kommentiert: Shraddha Joshi am 19 Apr. 2016
I am getting the following error when the AF signal is passed in Pan Tompkins algorithm.
Error using filtfilt>getCoeffsAndInitialConditions (line 181)
Data length must be larger than 18 samples.
Error in filtfilt (line 96)
[b,a,zi,nfact,L] = getCoeffsAndInitialConditions(b,a,Npts);
Error in pan_tompkin2 (line 194)
ecg_h = filtfilt(a,b,ecg);
I have downloaded AF Signals (MIT-BIH Arrhythmia Database as .mat) from physiobank-atm from physionet.org. Could you help in debugging it?
  3 Kommentare
Walter Roberson
Walter Roberson am 14 Apr. 2016
For the Arrhythmia database, which "record" are you downloading? Are you downloading MLII or V5 ? On the MATLAB side, how are you loading the data into MATLAB, and how are you passing the data into pan_tomkin2?
My suspicion is that you might be trying to pass the name of the .mat instead of the content of the .mat
Shraddha Joshi
Shraddha Joshi am 15 Apr. 2016
Bearbeitet: Walter Roberson am 15 Apr. 2016
I have attached a signal sample which I have downloaded along with Pan tompkins code I am using. Signal is downloaded as
In the Pan Tompkins code attached below, in the lines 118 and 153, the command i have used to load signals is,
ecg=load('100.mat')
instead of
ecg=load('ECG_sample_noisy.mat')

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 15 Apr. 2016
matstruct = load('100m.mat');
ecg = matstruct.val;
That is, you need to use the .val variable within the .mat. When you load() a .mat like that, returning a value, the result is a struct in which the fields are the names of the loaded variables.
  21 Kommentare
Walter Roberson
Walter Roberson am 19 Apr. 2016
I do not know anything about calculating heart rate from ecg signals. I do not know what rr intervals are. I was responding about sensitivity and specificity: to calculate those, you need information known by construction or expert opinion to be true.
Shraddha Joshi
Shraddha Joshi am 19 Apr. 2016
Ok thank you!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu ECG / EKG finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by