Borrar filtros
Borrar filtros

Preprocessing PTB-XL dataset in MATLAB

41 visualizaciones (últimos 30 días)
Ralph
Ralph el 13 de Jul. de 2024 a las 18:41
Comentada: Umar el 15 de Jul. de 2024 a las 4:08
Hello! How can I open specific records from PTB-XL dataset and process them in MATLAB? What I want to do is to first load the ECG leads loaded in .dat file one by one so that I can preprocess them, such as applying digital filters, prior to the creation of composite lead (mixture of 12-lead ECG in one waveform). I have WFDB tool from Physionet. However, it is not working on the dataset. I have the dataset downloaded in my laptop. Thank you!
  3 comentarios
Walter Roberson
Walter Roberson el 13 de Jul. de 2024 a las 20:59
I have WFDB tool from Physionet. However, it is not working on the dataset.
Could we get some more information as to how it is failing?
Ralph
Ralph el 14 de Jul. de 2024 a las 4:16
Editada: Ralph el 14 de Jul. de 2024 a las 4:17
Basically, when I try to follow the documentation in the tool, it keeps throwing an error that the file is nowhere to be found. It turns out that the tool is set to read files available in the PhysioBank ATM. PTB-XL is not available to that site.

Iniciar sesión para comentar.

Respuesta aceptada

Umar
Umar el 13 de Jul. de 2024 a las 19:18
Editada: Walter Roberson el 13 de Jul. de 2024 a las 20:50
Hi Ralph,
I can certainly help you with that. So, basically your objective is to open specific records from the PTB-XL dataset and process them in MATLAB which involves loading ECG leads from .dat files, preprocessing them by applying digital filters, and creating a composite lead. Since the WFDB tool from Physionet is not working for this dataset, you are looking alternative method to achieve this using MATLAB. You already know load the .dat file and its corresponding .hea file, since the WFDB tool is not working, you can directly read the .dat file using MATLAB's `fread` function, and parse the header information from the .hea file using standard file input/output functions. For more information on this function, please refer to,
Next step involves preprocessing the ECG leads, so once you have loaded the ECG leads, apply digital filters for preprocessing by installing DSP System Toolbox. For more information regarding DSP System Toolbox, please refer to
Finally, create a composite lead by simply combining the preprocessed ECG signals using MATLAB's array manipulation functions like `vertcat` or `horzcat`. For more information on these functions, please refer to
Here's a sample MATLAB script to illustrate the above steps:
% Step 1: Load the .dat file and its corresponding .hea file
fid = fopen('your_ecg_record.dat', 'r'); data = fread(fid, 'int16'); fclose(fid);
headerInfo = importdata('your_ecg_record.hea');
% Step 2: Preprocess the ECG leads
fs = headerInfo.SamplingFrequency; [b, a] = butter(4, [0.5 40]/(fs/2), 'bandpass'); filteredData = filter(b, a, data);
% Step 3: Create a composite lead
compositeLead = [filteredData1, filteredData2, ...]; % Combine all filtered ECG signals
% Additional considerations: You can further analyze and visualize the composite lead using MATLAB's plotting functions such as `plot` or `plotyy`. Additionally, consider saving the preprocessed data using MATLAB's `save` function for future use.
I hope this helps! Let me know if you need further assistance.
  5 comentarios
Ralph
Ralph el 15 de Jul. de 2024 a las 3:26
Yes, thank you for your help guys!
Umar
Umar el 15 de Jul. de 2024 a las 4:08
No problem, glad to know your issues have been resolved. If you still need any further assistance or help, please let us know. Good luck with your future endeavors.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Single-Rate Filters en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by