How to debug Error in Pan Tompkins?

6 visualizaciones (últimos 30 días)
Shraddha Joshi
Shraddha Joshi el 14 de Abr. de 2016
Comentada: Shraddha Joshi el 19 de Abr. de 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 comentarios
Walter Roberson
Walter Roberson el 14 de Abr. de 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 el 15 de Abr. de 2016
Editada: Walter Roberson el 15 de Abr. de 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')

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 15 de Abr. de 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 comentarios
Walter Roberson
Walter Roberson el 19 de Abr. de 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 el 19 de Abr. de 2016
Ok thank you!!

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by