ECG Processing contains different methods for processing electrocardiosignal using MATLAB.
The following processing procedures are presented:
- Digital filtering
- Spectrum analysis
- Calculation of arterial blood oxygen saturation
- Correlation analysis
- Classification of ECG with сorrelation analysis
The downloaded electrocardiogram signal samples (sampling rate = 250 Hz) were corrupted with noise (60 Hz). To filter the signal, a digital notch filter was developed in the Filter Designer utility, the AFC of which is shown in the figure:
The result of the signal filtering is presented below:
Power spectral density and amplitude spectrum of the electrocardio signal were plotted using the Fast Fourier Transform algorithm.
The obtained spectra are shown in the figure below:
To calculate blood oxygen saturation using the pulse oximetry signal, an algorithm for finding QRS complexes was developed. It is based on differentiation of ECG signal to hyperbolize signal changes and use a threshold rule with empirically selected coefficients.
Then we calculated pulse oximetry signal ranges of two wavelengths (600...700 nm and 810...960 nm) for obtained RR intervals. Calculating their average and using the formula the saturation value (~94%) was calculated.
The algorithm is illustrated by the figure below:
Correlation analysis methods were used to find periodicities and correlations between signals:
The autocorrelation function of ECG shows that there are repeating segments in the signal after fixed intervals of time.
Cross-correlation between pulse oximetry signals shows that these signals have the same dynamics of change but are shifted relative to each other by a certain time interval.
To classify QRS complexes using correlation analysis methods, labeled data were prepared, on which norms and pathologies were highlighted.
From each class, benchmarks were taken that were compared with other QRS complexes and the correlation value was calculated. Based on the obtained values, the algorithm classified QRS complexes into normal and pathological.
The result of the program's work is shown in the figure (real classes are shown in blue, and the classes obtained as a result of classification are shown in red):