Microsoft Word - BRAIN_vol9_issue1_2018_v7_final1.doc 17 Segmentation of Heart Sounds by Re-Sampled Signal Energy Method Omer Deperlioglu Afyon Kocatepe University, Afyonkarahisar, Turkey Erenler Mahallesi, Gazlıgöl Yolu Rektörlük E Blok, 03200 Afyonkarahisar Merkez, Turkey Tel.: +90 272 228 13 50 deperlioglu@aku.edu.tr Abstract Auscultation, which means listening to heart sounds, is one of the most basic medical methods used by physicians to diagnose heart diseases. These voices provide considerable information about the pathological cardiac condition of arrhythmia, valve disorders, heart failure and other heart conditions. This is why cardiac sounds have a great prominence in the early diagnosis of cardiovascular disease. Heart sounds mainly have two main components, S1 and S2. These components need to be well identified to diagnose heart conditions easily and accurately. In this case, the segmentation of heart sounds comes into play and naturally a lot of work has been done in this regard. The first step in the automatic analysis of heart sounds is the segmentation of heart sound signals. Correct detection of heart sounds components is crucial for correct identification of systolic or diastolic regions. Thus, the pathological conditions in these regions can be clearly demonstrated. In previous studies, frequency domain studies such as Shannon energy and Hilbert transformation method were generally performed for segmentation of heart sounds. These methods involve quite long and exhausting stages. For this reason, in this study, a re-sampled energy method which can easily segment heart sounds in the time domain has been developed. The results obtained from the experiments show that the proposed method segments S1 and S2 sounds very efficiently. Keywords: Cardiac sound characteristic, cardiac cycle, filtering, heart sounds, heart sound segmentation, re-sampled signal energy, 1. Introduction Deaths in heart diseases in the world are considerably higher than another stigma. For this reason, there are very intensive studies to develop new methods for diagnosis and treatment of heart diseases. Generally, there are three types of cardiac signals used to diagnose heart diseases. The first is Electrocardiogram (ECG) signals and electrical origin. ECG signals are the resultant signals that examine the electrical activity of the heart muscle. Second, Heart Sounds Signals (HSS) or their recordings, the Phonocardiograms (PCG), are defined as biological signals of physical origin. Heart sounds are the physical signals that result in mechanical movements of the heart. Another signal is called Photoplethysmography (PPG). PPG is a simple optical technique used to perceive volume changes in the peripheral circulation. In other words, it is a non-invasive method that measures changes in blood pressure. ECG, PCG and PPG can occur in different forms due to different cardiac conditions due to heart disease. These differences can be used to diagnose heart disorders. In recent years, many computer-aided studies have been conducted in clinical applications such as automatic segmentation and classification using PCG and ECG signals in order to accurately detect heart related disorders. A great majority of these studies are about heart sounds. The studies done on PCGs is mostly to provide infrastructure for decision support systems by classifying them. In classification studies, Support Vector Machines (SVM) algorithm is mostly used with different kernel functions from artificial intelligence methods. As an example, Zhenga and colleagues implemented intelligent diagnostics for chronic heart failure using the least squares method of support vector machine classification (SVM) algorithm (Zhenga et al., 2015). Patidar et al. Classify BRAIN – Broad Research in Artificial Intelligence and Neuroscience, Volume 9, Issue1 (February, 2018), ISSN 2067-8957 18 the PCG signals for the detection of heart valve disease using different core methods (Patidar et al., 2014). In the Azmy study, normal and abnormal PCG signals were classified by the SVM method using a new main wavelet (Azmy 2015). Maglogiannis et al. have developed a diagnostic system by classifying PCG signals of this condition with the SVM-based classification method to define the heart valve disease (Maglogiannis et al., 2009). Shuping Sun et al. have classed PCG signals using the SVM method to detect disturbance of ventricular symptoms (Shuping Sun et al. 2014). Ari et al. Have developed a system for identifying cardiac abnormalities by classifying PCG signals with the SVM-based least squares method (Ari et al. 2010). Guermoui et al classified PCG signals of five different disorders using the SVM method as normal, including aortic stenosis, aortic insufficiency, mitral stenosis and mitral insufficiency (Guermoui, et al. 2013). Artificial Neural Network (ANN) is a widely used method for classification, although it is not as common as support vector machines. For example, Güraksin and his colleagues classify PCG signals using ANN by developing a Windows operating system-based application. In this study, they used PCG signals related to Normal, Pulmonary Stenosis and Mitral Stenosis disorders, and Discrete Fourier Transform (DFT) for frequency analysis. (Guraksin et al 2009). Segmentation comes to the fore in order to increase the efficiency and the performance ratio of the classification studies. The segmentation methods of heart sounds that are made previously studies can be divided into two main groups in general. These are some methods using a reference such as ECG to synchronize the segmentation, and other methods that do not use the reference. El- Segaier et al. in their study based on the ECG reference, they first detected QRS complexes and T waves to find S1 and S2 segments, respectively (El-Segaier et al., 2005). Carvalho and his colleagues have tried to overcome this problem by using an unclassified classifier in the selection of the S2 voices because the T waves in the low-quality ECG signals cannot be clearly selected (Carvalho et al., 2005). Many researchers have tried to identify S1 and S2 voices with a few signal processing and statistical methods to reduce excessive workload, without using the ECG as a reference (Kumar, 2006). Elgendi et al. have developed a Daubechies wavelet algorithm for the automatic detection of S1 and S2 using the wavelet coefficient ‘D6’ based on power spectral analysis (Elgendi et al., 2015). Other approaches include uncontrolled techniques such as self-organizing map using envelope (Liang, Lukkarinen, & Hartimo, 1997), spectrogram quantization method (Liang, Lukkarinen, & Hartimo, 1998) and Mel frequency cepstrum coefficients (2006). Choi and Jiang, have made a comparative study about Shannon energy, the envelope information of Hilbert transform, and the cardiac sound characteristic waveform. They said that proposed algorithm provided sufficient performance compared to conventional Shannon envelope and Hilbert envelope algorithms (Choi & Jiang, 2008). The algorithm proposed by Saini is an automatic detection of two dominant heart sounds based on a 3-order normalized mean Shannon energy envelope. This proposed automatic detection and analysis algorithm can effectively detect heart sounds S1 and S2 by reducing the effect of noises in heart sounds. Due to the fact that the signal and the envelope calculation is pre-processed, the noises in the heart sounds can be easily suppressed (Saini, 2016). Oweis, Hamad, & Shammout, describe in detail a method for segmenting heart sounds based on the energy operator of the Teager to perform heart sound segmentation in their work. The proposed segmentation method divides the heart sound signal into two heart sounds, S1 and S2, which dominate, and periods that show systole and diastole durations (Oweis, Hamad, & Shammout, 2014). Kudriavtsev, Polyshchuk, and Roy proposed a method of analyzing heart sounds using the Cohen class common time-frequency transformations in their work. They have shown the results of applying these methods to normal and abnormal heart sounds. This method allows for detailed quantitative characterization of heart sounds. It uses a system of integral drawings that characterizes frequency changes with both visual images and time-averaged instantaneous sound intensity (Kudriavtsev, Polyshchuk, & Roy, 2007). O. Deperlioglu - Segmentation of Heart Sounds by Re-Sampled Signal Energy Method 19 In this study, a new method proposed that have been segmented heart sounds using by signal energy method based on re-sampling heart sounds signal. Firstly, the PCG signals have been pre- processed to involve the re-sampling and normalization of the original recording. After the filtering, re-sampled signal energy calculation is applied on PCG with 100 ms sampling rate. It is presented these steps of Re-sampled signal energy methods that is used for segmentation of S1, S2 in detailed. 2. Characteristics of Heart sounds and Phonocardiogram Listening to heart sounds is one of the most commonly used methods of diagnosing heart diseases and is called auscultation. Generally, the sounds handled by healthy hearts are the same and are called normal sounds. Sounds from hearts with physical anomalies are irregular and are called abnormal sounds. Heart sounds are listened with acoustic stethoscopes in clinical settings. Acoustic stethoscope, which is usually low accuracy level, now leaves its place with electronic stethoscope. Electronic stethoscope can detect very low density or very high frequency heart sounds that cannot be heard completely on an acoustic instrument. The waveforms of the heart sounds are more important than the heart sounds themselves in terms of diagnosis. Heart sounds are generated by the mechanical movements that occur during the heart cycle. These sounds consist of heart events, such as the movement of the heart valves, the opening and closing of the valves, and the leakage of blood flow. Figure 1 shows the general form and components of heart sounds. Figure 1. General form and components of heart sounds Heart sounds are mainly produced by closing the valves between the upper and lower regions of the heart. That is, at the end of the atrial contraction and at the beginning of the ventricular contraction. The first sound is generated by the closing of the mitral and tricuspid valve, usually in the range of 30 to 100 Hz frequencies, and has a duration of 50 to 100 ms. The second sound is formed by a mild backflow channel in the heart before the valve closes and then the veins are closed from the ventricles. It has a higher frequency than the first one. Frequencies are usually above 100 Hz and have a duration of 25-50 ms. The first sound is called S1 and the second sound is called S2. The interval between S1 and S2 sounds is defined as systole, and the interval between S2 and S1 is defined as diastole. Regular or irregular intervals may be used to diagnose heart conditions. As shown in Figure 2, heart sounds are not only S1 and S2, but also S3 and S4 sounds. But they are not heard normally because they are at a much lower level. S3 sound occurs in the ventricles with blood flow. S4 sounds are caused by atrial narrowing. These voices are called diastolic voices and are usually not heard in normal adults. However, it is often heard in children. (Ahlström 2006; Kudriavtsev, 2007). During the heart cycle, the heart primarily performs electrical operations. Electrical activity then causes atrial and ventricular contractility. It forces the blood circulating in the body with the BRAIN – Broad Research in Artificial Intelligence and Neuroscience, Volume 9, Issue1 (February, 2018), ISSN 2067-8957 20 heart chambers. The opening and closing of the heart valves is due to blood acceleration-slowing, which leads to whole heart vibration (Leatham 1975). These vibrations can be heard from the chest wall. Thus, the condition of the heart can be understood by listening to the heart sounds. Figure 2. First, Second, Third and Fourth Heart Sounds (Kudriavtsev, 2007) 3. Segmentation of Heart Sounds In order to develop diagnostic tools for automatic heart disorders using phonocardiogram signals, it is necessary to segment the heart sound into clinically meaningful segments. For example, the systole and diastole spacing, or the segmentation of S1 and S2 audio components, must be detected. When they are detected, the features required for diagnosis can be removed for each type of sound. At the same time, the clear identification of S1 and S2 sounds is one of the most difficult stages to analyze heart sounds. The first step for automatic analysis of heart sounds is segmentation of heart sounds. Correct placement of heart sounds is necessary to accurately determine systolic or diastolic intervals. Differences in these regions are a sign of heart disease symptoms. (Liang et al., 1997). In addition, while the heart sounds are recorded, the pressure applied to the stethoscope, the sounds in the surroundings and the sounds in other body organs also act. This causes noise to occur in the heart sounds. For this reason, pre-processing of heart sounds usually begins with step of normalization and filtering. Utilizing the resampled energies of heart sounds, S1 or S2 sounds are segmented to form the infrastructure for classification. The flow chart for these operations is given in Figure 3. The processes given in the segmentation flow chart of heart sounds are briefly summarized below. MATLAB R2017a is used for segmentation of heart sounds. 3.1. Resampling and Normalization Resampling of PCG is usually done to regulate sound value with different sampling rates. Resampling should be re-sampled with the same sampling frequency if the heart sounds in the database are recorded with different devices or the sampling times are different. For example, in this study, the all data in the dataset are 1000 Hz (Fs = 1000 Hz). They have not been rearranged at the any sampling frequency. Only normalization was performed in this study. In addition, heart sounds must be normalized before noise extraction. Normalization can be performed as in Equation 1. O. Deperlioglu - Segmentation of Heart Sounds by Re-Sampled Signal Energy Method 21 Figure 3. Process flow diagram in the segmentation of heart sounds Figure 4. PCG image after normalization BRAIN – Broad Research in Artificial Intelligence and Neuroscience, Volume 9, Issue1 (February, 2018), ISSN 2067-8957 22      ][max nx =n norm x nx (1) The sample normalization scheme was given in Figure 4. 3.2. Filtering Filtering is usually carried out the noises of signal in biomedical systems using digital filters. Numerical filtering is defined as the acquisition of desired frequency values according to the characteristics of the desired filter in order to improve the signal in terms of its intended use (Shenoi, 2005; Thede, 1995). In generally, these filters are designed four types to perform the following operations on unwanted frequency values in the original signal.  If it is above a certain value, it is filtered low.  If it is below a certain value, the high-pass filter is filtered.  If it is between certain values, the band stops filtering.  If it is outside certain values, it is a band-pass filter. In this study, Butterworth, Chebyshev and Elliptic digital filters which are widely used for filtering are used. Examples for different filtering operations for the same heart sound are given in Figure 5. Figure 5. Filtering heart sounds with Butterworth, Chebyshev and Elliptic digital filters 3.3. Energy of Heart Sounds In order to determine the beginning and end of the sounds, energy of the sound must be determined. Energy parameters have been used since 1970 to determine the beginning and end points. The calculation of the energy of the sound signal is a simple process when compared to other processes. There are two basic parameters in the processing of the sound signal such as zero crossing rate and short time energy. Generally, these two parameters are calculated before others. O. Deperlioglu - Segmentation of Heart Sounds by Re-Sampled Signal Energy Method 23 Nearly half of the results of false recognition result from incorrect detection of the ending point (Bulbul & Karaci 2007; Qiang and Youwei, 1998). The biggest problem encountered during the development of sound partitioning systems is to detect the beginning and end of the sound. If the sound signal exceeds a specified threshold energy, it indicates that the sound signal has started. The sound signal falls below a certain threshold energy and this low energy continuation indicates that the sound signal is over (Dogan,1999). The numbers of transitions of the sound signal from zero are low in the sections where the sound parts are included. This feature is used to determine the beginning and end points of the sound expressions (Bulbul & Karaci, 2007). A short time energy calculation is used to calculate the energy that the sound signal has at a given time. The short time energy calculation has three different definitions (Bulbul and Karaci, 2007; Qiang and Youwei, 1998). Logarithm Energy :    N i ixE 1 2)(log (2) Sum Of Square Energy:    N i ixE 1 2)( (3) Sum Of Absolute Energy:    N i ixE 1 )( (4) In this study, a Sum of Square Energy function in Equation 3 was used with resampling of the filtered signal. The screen capture of the MATLAB codes for the re-sampled energy calculation is shown in Figure 6. The resampling time is selected as 100 milliseconds. Figure 6. The screen capture of the MATLAB codes for the resampled energy calculation Graphs of re-sampled energy signals for Butterworth, Chebyshev and Elliptic filters is given in Figure 7. Elliptic filter was used on segmenting process. BRAIN – Broad Research in Artificial Intelligence and Neuroscience, Volume 9, Issue1 (February, 2018), ISSN 2067-8957 24 Figure 7. Graphs of resampled energy signals for Butterworth, Chebyshev and Elliptic filters 3.4. Segmentation of heart sounds The phonocardiogram, re-sampled energy and time intervals were given in Figure 8. As shown in Figure 8, the re-sampled energy graphs of heart sounds consist of big, and small triangles. The big triangles correspond to the S1 sounds, and the small triangles correspond to the S2 sounds in the graph. Segmentation can be done easily by taking advantage of the base lengths of these triangles. In other words, by selecting intervals where the energy is different from zero, segmentation of s1 and s2 sounds can be done. Sample segmentation for T1, T2, T3, and T4 intervals in Figure 8 were given in Figure 9 (a), (b), (c), (d), respectively. It is seen that T1 and T3 time intervals correspond to S2 sounds and T2, and T4 time intervals correspond to S1 sounds. The desired sound signal at the desired time interval can be selected. In addition, when the signal is filtered with making necessary adjustments in the filter, method can be segmented only for S1 sounds. The results of the phonocardiogram, re-sampled energy and time intervals obtained in the study for the same signal with filter arrangement were given in Figure 10. It is seen in Figure 10 that the T1, T2, and T3 time intervals correspond only to S1 sounds. Already, the selection of the first segment is sufficient. Sample segmentations for T1, T2, T3, and T4 intervals in Figure 10 were given in Figure 11 (a), (b), (c), (d), respectively. O. Deperlioglu - Segmentation of Heart Sounds by Re-Sampled Signal Energy Method 25 Figure 8. The phonocardiogram, resampled energy and time intervals Figure 9. Sample segmentation for T1, T2, T3, and T4 intervals in Figure 8 BRAIN – Broad Research in Artificial Intelligence and Neuroscience, Volume 9, Issue1 (February, 2018), ISSN 2067-8957 26 Figure 10. The phonocardiogram, resampled energy and time intervals for new filter settings Figure 11. Sample segmentation for T1, T2, T3, and T4 intervals in figure 10 O. Deperlioglu - Segmentation of Heart Sounds by Re-Sampled Signal Energy Method 27 4. Conclusions In order to develop diagnostic tools for automatic heart disorders using phonocardiogram signals, it is necessary to segment the heart sound into clinically meaningful segments. So, the PCG signals need to be segmented for definition of these differences. In previous studies, frequency domain studies such as Shannon energy and Hilbert transformation method were generally performed for segmentation of heart sounds. These methods involve quite long and exhausting stages. For this reason, in this study, a re-sampled energy method which can easily segment heart sounds in the time domain has been developed. The obtained results from the experiments show that the proposed method segments S1 and S2 sounds very efficiently. In this study, only Butterworth, Chebyshev 1 and Elliptical filters have been tested on digital filters in the process of filtering heart sounds. Different digital filters can be tried in subsequent studies. Different filters may be suggested in the literature for different heart sounds databases. In addition, time intervals can be clarified with artificial intelligence optimization methods. The location and size of the heart sounds can be fully clarified. 5. Acknowledgment This paper has been supported by Afyon Kocatepe University Scientific Research and Projects Unit with the Project number 17.KARİYER.60 References Ahlström, C. (2006). Processing of the Phonocardiographic Signal-Methods for the Intelligent Stethoscope, Disseration, Linköping University, Institute of Technology, Linköping, Sweden. Ari, S., Hembram, K., Saha, G. (2010). Detection of cardiac abnormality from PCG signal using LMS based least square SVM classifier, Expert Systems with Applications, vol. 37: 8019 - 8026. Azmy, M. M. (2015). Classification of normal and abnormal heart sounds using new mother wavelet and support vector machines, 4th International Conference on Electrical Engineering (ICEE), 1-3. Bulbul, H.I., Karaci, A., (2007). Speech Command Recognition In Computer: Pattern Recognition Method. Kastamonu Education Journal, 15(1), 45-62. Carvalho, P., Gil, P., Henriques, J., Antunes M. & Eug´enio, L. (2005). Low Complexity Algorithm for Heart Sound Segmentation using the Variance Fractal Dimension, Proc. Of the Int. Sym. on Intelligent Signal Processing, 2005, 593-595. Choi, S., Jiang, Z. (2008). Comparison of envelope extraction algorithms for cardiac sound signal segmentation, Expert Systems with Applications, 34, 1056–1069. Dogan,S. (1999). Recognation of voice Commands in the PC Environment, Master thesis, Marmara University, İnstitute of Science and Technology, İstanbul. Elgendi M, Kumar S, Guo L, Rutledge J, Coe JY, Zemp R, et al. (2015). Detection of Heart Sounds in Children with and without Pulmonary Arterial Hypertension―Daubechies Wavelets Approach. PLoS ONE, 10(12): e0143146. El-Segaier, M., Lilja, O., Lukkarinen, S., Srnmo, L., Sepponen R. & Pesonen, E. (2005). Computer- Based Detection and Analysis of Heart Sound Murmur, Annals of Biomedical Engineering, 33 (7), 937-942. Guermoui, M., Mekhalfi, M. L. and Ferroudji, K. (2013). Heart sounds analysis using wavelets responses and support vector machines, in Systems, 8th International Workshop on Signal Processing and their Applications (WoSSPA), 233-238. Guraksin, G. E., Ergun, U. and Deperlioglu, O. (2009). Performing discrete Fourier transform of the heart sounds on the pocket computer. 14th National Biomedical Engineering Meeting, BIYOMUT 2009, pp. 1-4. BRAIN – Broad Research in Artificial Intelligence and Neuroscience, Volume 9, Issue1 (February, 2018), ISSN 2067-8957 28 Kumar, D., Carvalho, P. Gil, P. Henriques, J., Antunes, M. & Eug´enio, L. (2006). A new algorithm for detection of S1 and S2 heart sounds, in Int. Conf. of Acoustic and Speech Signal Processing (ICASSP 2006), 1180-1183. Kudriavtsev, V., Polyshchuk, V. & Roy D. L. (2007). Heart energy signature spectrogram for cardiovascular diagnosis, BioMedical Engineering OnLine, 6(16): 1-22. Leatham, A. (1975). Auscultation of the heart and phonocardiography. Churchill Livingstone. Liang, H., Lukkarinen, S. & Hartimo, I. (1997). Heart Sound Segmentation Algorithm Based on Heart Sound Envelogram, Proc. of IEEE Computers in Cardiology, 105-108. Liang, H., Lukkarinen, S. & Hartimo, I. (1998). A boundary modification method for heart sound segmentation algorithm”, in Proc. of IEEE Computers in Cardiology, 593-595. Maglogiannis, I., Loukis, E., Zaropoulos, E., Stasis, A. (2009). Support Vectors Machine-based identification of heart valve diseases using heart sounds, Computer Methods and Programs in Biomedicine, 95: 47 - 61. Oweis, R. J., Hamad, H., & Shammout, M. (2014). Heart Sounds Segmentation Utilizing Teager Energy Operator, Journal of Medical Imaging and Health Informatics, 4(4), 1-12. Patidar, S., Pachori, R. B. (2014). Classification of cardiac sound signals using constrained tunable- Q wavelet transform, Expert Systems with Applications, 41(16): 7161 - 7170. Saini, M. (2016). Proposed Algorithm for Implementation of Shannon Energy Envelope for Heart Sound Analysis, International Journal of Electronics & Communication Technology IJECT, 7(1), 15-19. Shenoi, B.A. (2005). Introduction to Digital Signal Processing and Filter Design, John Wiley & Sons Inc. Shuping Sun, H. W., Jiang, Z., Fang, Y. and Tao, T. (2014). Segmentation-based heart sound feature extraction combined with classifier models for a VSD diagnosis system, Expert Systems with Applications, 41: 1769 - 1780. Qiang, H., Youwei, Z. (1998). On prefiltering and endpoint detection of speech signal, Signal Processing Proceedings ICSP '98. 1998 Fourth International Conference on, 1: 749,750. Thede, L. (1995) Analog & Digital Filter Design Using C, Prentice Hall; 1 edition. Zhenga, Y., Guoa, X., Qinb, J., Xiao, S. (2015). Computer-assisted diagnosis for chronic heart failure by the analysis of their cardiac reserve and heart sound characteristics, Computer Methods and Programs in Biomedicine, 122(3): 372 - 383. Omer DEPERLIOGLU (b. May 15, 1967) received his BSc in Electric and Electronic (1988) Gazi University, MSc in Computer Science (1996) from Afyon Kocatepe University, PhD in Computer Science (2001) from Gazi University in Turkey. Now he is associate professor of Computer Programming in Department of Science, Vocational School of Afyon, Afyon Kocatepe University of Afyon, Turkey. His current research interests include different aspects of Artificial Intelligence applied in Power Electronics, Biomedical, and Signal Processing. He has edited 1 book and (co-) authored 3 books and more than 20 papers, more than 30 conferences participation, member in International Technical Committee of 4 conferences and workshops.