Azzera filtri
Azzera filtri

How to debug Error in Pan Tompkins?

2 visualizzazioni (ultimi 30 giorni)
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 Commenti
Walter Roberson
Walter Roberson il 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 il 15 Apr 2016
Modificato: Walter Roberson il 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')

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 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 Commenti
Walter Roberson
Walter Roberson il 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 il 19 Apr 2016
Ok thank you!!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su ECG / EKG in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by