Electrocardiography Compression using Fast Fourier Transform

DOI : 10.17577/IJERTV2IS60021

Download Full-Text PDF Cite this Publication

Text Only Version

Electrocardiography Compression using Fast Fourier Transform

Amol R. Madane Gajanan G. Kale

Tata Consultancy Services Ltd., Dr. N. P. Hirani Polytechnic, Pune Pusad

In this project Transform based signal compression is proposed. This method is used to exploit the redundancy in the signal. This Paper uses Wavelet Transform to compress the signals. We compare the two existing wavelet methods with the proposed algorithm to determine which of them has better compression ratio (CR) and percent root mean square difference (PRD) [1]. The appropriate use of a block based DCT associated to a uniform scalar dead zone quantiser and arithmetic coding show very good results, confirming that the proposed strategy exhibits competitive performances compared with the most popular compressors used for ECG compression. Each specific transform is applied to a pre-selected data segment from the CSE database, and then compression is performed [2]. The appropriate use of a block based DCT associated to a uniform scalar dead zone quantiser and arithmetic coding show very good results, confirming that the proposed strategy exhibits competitive performances compared with the most popular compressors used for ECG compression. Each specific transform is applied to a pre-selected data segment from the MIT-BIH database and then compression is performed [3]. A wide range of compression techniques based on different transformation techniques like DCT, FFT; DST & DCT2 were evaluated to find an optimal compression strategy for ECG data compression. Wavelet compression techniques were found to be optimal in terms of compression [4].

Electrocardiogram

An electrocardiogram (ECG or EKG, abbreviated from the German Electrocardiogram) is a graphic produced by an electrocardiograph, which records the electrical activity of the heart over time. Analysis of the various waves and normal vectors of depolarization and repolarisation yields important diagnostic information.

  • It is the gold standard for the diagnosis of cardiac arrhythmias.

  • It guides therapy and risk stratification for patients with suspected acute myocardial infarction.

  • It helps detect electrolyte disturbances (e.g. hyperkalemia and hypokalemia).

In this project Transform based signal compression is proposed. This method is used to exploit the redundancy in the signal. This Paper uses Wavelet Transform to compress the signals. We compare the two existing wavelet methods with the proposed algorithm to determine which of them has better compression ratio (CR) and percent root mean square difference (PRD) [1]. The appropriate use of a block based DCT associated to a uniform scalar dead zone quantiser and arithmetic coding show very good results, confirming that the proposed strategy exhibits competitive performances compared with the most popular compressors used for ECG compression. Each specific transform is applied to a pre-selected data segment from the CSE database, and then compression is performed [2]. The appropriate use of a block based DCT associated to a uniform scalar dead zone quantiser and arithmetic coding show very good results, confirming that the proposed strategy exhibits competitive performances compared with the most popular compressors used for ECG compression. Each specific transform is applied to a pre-selected data segment from the MIT-BIH database and then compression is performed [3]. A wide range of compression techniques based on different transformation techniques like DCT, FFT; DST & DCT2 were evaluated to find an optimal compression strategy for ECG data compression. Wavelet compression techniques were found to be optimal in terms of compression [4].

Electrocardiogram

An electrocardiogram (ECG or EKG, abbreviated from the German Electrocardiogram) is a graphic produced by an electrocardiograph, which records the electrical activity of the heart over time. Analysis of the various waves and normal vectors of depolarization and repolarisation yields important diagnostic information.

  • It is the gold standard for the diagnosis of cardiac arrhythmias.

  • It guides therapy and risk stratification for patients with suspected acute myocardial infarction.

  • It helps detect electrolyte disturbances (e.g. hyperkalemia and hypokalemia).

Abstract

This research paper presents an Electrocardiography (ECG) compression based on optimized quantization of Fast Fourier Transform (FFT) coefficients. The ECG to be compressed is partitioned in blocks of fixed size, and each FFT block is quantized using a quantization vector that are specifically defined for each signal. The Percent Root-Mean-Square Difference (PRD) was adopted as a measure of the distortion introduced by the compressor. We also present traces of test signals before and after the compression/decompression process. The results show that the proposed method achieves good compression ratios (CR). The objective is realized by constructing and designing an algorithm & software for compression which would enable optimal storage of ECG signals in the database for future references.

Keywords

Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), Electrocardiography (ECG), Fast Fourier Transform (FFT).

  1. Introduction

    Here the input ECG signal is in .mat file format (MATLAB database text file), which is loaded for compression using load instruction.

    Sample ECG Database signals were compressed, measured by the percent root-mean square difference (PRD), and the compression ratios (CR) were computed. We present traces of original and decompressed signals. The method achieves good CR values with excellent reconstruction quality.

    The performance of compression of signals is evaluated on the basis of

    1. Compression ratio (CR),

    2. Percent-root-mean-square difference (PRD).

    This project implements ECG compressor based on optimized quantization of Fast Fourier transform (FFT) coefficients.

  2. Technical Background

    • It allows for the detection of conduction abnormalities (e.g. right and left bundle branch block) and many others.

    The electrocardiogram does not directly assess the contractility of the heart. However, it can give a rough indication of increased or decreased contractility.

    • It allows for the detection of conduction abnormalities (e.g. right and left bundle branch block) and many others.

    The electrocardiogram does not directly assess the contractility of the heart. However, it can give a rough indication of increased or decreased contractility.

    A Fast Fourier Transform (FFT) is an efficient algorithm to compute the discrete Fourier transform (DFT) and its inverse. FFTs are of great importance to a wide variety of applications, from digital signal processing to solving partial differential equations to algorithms for quickly multiplying large integers. This article describes the algorithms, of which there are many; see discrete Fourier transform for properties and applications of the transform.

    Let x0, … xN-1 be complex numbers. The DFT is defined by the formula

    A Fast Fourier Transform (FFT) is an efficient algorithm to compute the discrete Fourier transform (DFT) and its inverse. FFTs are of great importance to a wide variety of applications, from digital signal processing to solving partial differential equations to algorithms for quickly multiplying large integers. This article describes the algorithms, of which there are many; see discrete Fourier transform for properties and applications of the transform.

    Let x0, … xN-1 be complex numbers. The DFT is defined by the formula

    FFT (Fast Fourier Transform)-

    Evaluating these sums directly would take O (N2) arithmetical operations (see Big O notation). An FFT is an algorithm to compute the same result in only O(N log N) operations. In general, such algorithms depend upon the factorization of N, but (contrary to popular misconception) there are FFTs with O (N log N) complexity for all N, even for prime N.

    Many FFT algorithms only depend on the fact that is a primitive root of unity, and thus can be applied to analogous transforms over any finite field, such as number-theoretic transforms.

    4. Waves and intervals

    4. Waves and intervals

    Fig 2: Schematic representation of normal ECG

    3. ECG Signal Recording

    The above figure illustrates the process of recording ECG signal.

    3. ECG Signal Recording

    The above figure illustrates the process of recording ECG signal.

    Fig 1: Schematic representation of ECG Signal

    A typical ECG tracing of a normal heartbeat (or cardiac cycle) consists of a P wave, a QRS complex and a T wave. A small U wave is normally visible in 50 to 75% of ECGs. The baseline voltage of the electrocardiogram is known as the isoelectric line. Typically the isoelectric line is measured as the portion of the tracing following the T wave and preceeding the next P wave.

    P wave

    During normal arterial depolarization, the mean electrical vector is directed from the SA node towards the AV node, and spreads from the right atrium to the left atrium. This turns into the P wave on the EKG, which is upright in II, III, and aVF (since the general electrical activity is going toward the positive electrode in those leads), and inverted in aVR (since it is going away from the positive electrode for that lead). A P wave must be upright in leads II and aVF and inverted in lead aVR to designate a cardiac rhythm as Sinus Rhythm.

    PR interval

    The PR interval is measured from the beginning of the P wave to the beginning of the QRS complex. It is usually 0.12 to 0.20 sec (120 to 200 ms). On an ECG tracing this is defined as 3 to 5 small boxes.

    A typical ECG tracing of a normal heartbeat (or cardiac cycle) consists of a P wave, a QRS complex and a T wave. A small U wave is normally visible in 50 to 75% of ECGs. The baseline voltage of the electrocardiogram is known as the isoelectric line. Typically the isoelectric line is measured as the portion of the tracing following the T wave and preceeding the next P wave.

    P wave

    During normal arterial depolarization, the mean electrical vector is directed from the SA node towards the AV node, and spreads from the right atrium to the left atrium. This turns into the P wave on the EKG, which is upright in II, III, and aVF (since the general electrical activity is going toward the positive electrode in those leads), and inverted in aVR (since it is going away from the positive electrode for that lead). A P wave must be upright in leads II and aVF and inverted in lead aVR to designate a cardiac rhythm as Sinus Rhythm.

    PR interval

    The PR interval is measured from the beginning of the P wave to the beginning of the QRS complex. It is usually 0.12 to 0.20 sec (120 to 200 ms). On an ECG tracing this is defined as 3 to 5 small boxes.

    The duration, amplitude, and morphology of the QRS complex is useful in diagnosing cardiac arrhythmias, conduction abnormalities, ventricular hypertrophy, myocardial infarction, electrolyte derangements, and other disease states.

    The duration, amplitude, and morphology of the QRS complex is useful in diagnosing cardiac arrhythmias, conduction abnormalities, ventricular hypertrophy, myocardial infarction, electrolyte derangements, and other disease states.

    QRS Complex

    Q Wave

    Q waves can be normal (physiological) or pathological. Normal Q waves, when present, represent depolarization of the interventricular septum. For this reason, they are referred to as septal Q waves, and can be appreciated in the lateral leads I, aVL, V5 and V6.

    ST segment

    The ST segment connects the QRS complex and the T wave and has duration of 0.08 to 0.12 sec (80 to 120 ms). It starts at the J point (junction between the QRS complex and ST segment) and ends at the beginning of the T wave. The normal ST segment has a slight upward concavity. Flat, down sloping, or depressed ST segments may indicate coronary ischemia. ST segment elevation may indicate myocardial infarction.

    T wave

    The T wave represents the depolarization (or recovery) of the ventricles. The interval from the beginning of the QRS complex to the apex of the T wave is referred to as the absolute refractory period. The last half of the T wave is referred to as the relative refractory period (or vulnerable period).

    QT interval

    The QT interval is measured from the beginning of the QRS complex to the end of the T wave. A normal QT interval is usually about 0.40 seconds. The QT intervals as well as the corrected QT interval are important in the diagnosis of long QT syndrome and short QT syndrome. The QT interval varies based on the heart rate, and various correction factors have been developed to correct the QT interval for the heart rate.

    Q Wave

    Q waves can be normal (physiological) or pathological. Normal Q waves, when present, represent depolarization of the interventricular septum. For this reason, they are referred to as septal Q waves, and can be appreciated in the lateral leads I, aVL, V5 and V6.

    ST segment

    The ST segment connects the QRS complex and the T wave and has duration of 0.08 to 0.12 sec (80 to 120 ms). It starts at the J point (junction between the QRS complex and ST segment) and ends at the beginning of the T wave. The normal ST segment has a slight upward concavity. Flat, down sloping, or depressed ST segments may indicate coronary ischemia. ST segment elevation may indicate myocardial infarction.

    T wave

    The T wave represents the depolarization (or recovery) of the ventricles. The interval from the beginning of the QRS complex to the apex of the T wave is referred to as the absolute refractory period. The last half of the T wave is referred to as the relative refractory period (or vulnerable period).

    QT interval

    The QT interval is measured from the beginning of the QRS complex to the end of the T wave. A normal QT interval is usually about 0.40 seconds. The QT intervals as well as the corrected QT interval are important in the diagnosis of long QT syndrome and short QT syndrome. The QT interval varies based on the heart rate, and various correction factors have been developed to correct the QT interval for the heart rate.

    • Initialize the values in the range of 0.10 and –

      0.10 of the FFT of the input ECG signal to zero.

    • Perform step 9 again by using a new counter variable and plot the new FFT values graph

    • Calculate Compression Ratio and Percent-root- mean-square difference (PRD) of the new compressed signal and plot it.

    • Calculate the errors introduced in the signal (as data is lost in the FFT compression)

    • Plot the Error in the Signal

5. Results

This will ask the user to enter the desired ECG signal to be compressed.

Fig 3: Graphical User Interface

4. ECG signal compressed using FFT Algorithm

4. ECG signal compressed using FFT Algorithm

Following are the steps that user needs to follow to complete the algorithm,

  • Take input ECG signal in .mat format to compression

  • Load the above .mat file for compression

  • Initialize a variable END that will calculate the length of the signal

  • Input the actual ECG signal from the file in terms of x and y

  • Plot the original ECG signal

  • Take FFT o the input signal and plot it

  • Initialize a counter that will count the number of points where FFT of the input ECG signal is not equal to zero.

Fig 4: Actual ECG signal compressed using FFT algorithm

Conclusion

The ECG signal compression is required for two main reasons, effective and economic data storage

and on-line transmission of the signal.ECG signal can be compressed using Fast Fourier Transform- Lossy Compression and the PRD and Compression Ratio are calculated.

References

  1. P. K. Charles, and R. Prasad K, A Contemporary Approach for ECG Signal compression using Wavelet Transform, Signal & Image Processing: An International journal (SIPIJ), Vol. 2, NO. 1, March 2011, pp 178-189.

  2. P. Sigh, O. P. Yadav, and Y. Yadav, ECG Signal compression Implementation by a New 2-Dimensional Transform Technique, International Journal of Engineering and Advanced Technology (IJEAT), Vol-1, Issue-6, August 2012, pp 167-170.

  3. M. Sharma, Dr. A. K. Wadhwani, Efficient Algorithm for ECG Coding, Internal Journal of scientific and Engineering Research, Vol-2, Issue 6, June 2011, pp 1-9.

  4. A. Khare, M. Saxena, V. Nerkar, ECG Data Compression Using DWT, International journal of Engineering and Advanced Technology (IJEAT), Vol-1, Issue-1, October 2011, pp 11-13.

Leave a Reply