Phonocardiogram Event-Based Delineation Method Usi

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

How to Cite:

Shervegar, V. M. (2022). Phonocardiogram event-based delineation method using


continuous wavelet transform. International Journal of Health Sciences, 6(S4), 4039–4054.
https://doi.org/10.53730/ijhs.v6nS4.9032

Phonocardiogram event-based delineation


method using continuous wavelet transform

Dr. Vishwanath Madhava Shervegar


Associate Professor, Mangalore Institute of Technology and Engineering,
Moodbidri, Dakshina Kannada, Karnataka, India
Corresponding author email: [email protected]

Abstract---Objective: This paper represents a new method of


Phonocardiogram delineation using the heart sound events extracted
from the Continuous Wavelet transformation of the Phonocardiogram.
Methods: The Phonocardiogram signals were filtered using the
Chebyshev bandpass Type-II filter to remove the noise. A two-
dimensional Time-Frequency Continuous Wavelet Transform operator
was applied to the Phonocardiograms to convert the audio signal into
the time-frequency Spectrogram. The Row sum of the Spectrogram
matrix was evaluated by summing the matrix for all frequencies along
with the time axis. The average of the row sum was calculated. This
average value was then subtracted from the row sum. The intersection
of the deduced row sum, after subtraction, indicated the boundaries
of the Phonocardiogram. Beat identification in the Phonocardiogram
was done using Fast Fourier Transform. Conclusion: The method can
identify the boundaries of the sounds in the Phonocardiogram and
indicate the presence of the First heart sound-systole-Second heart
sound-diastole sequence with an accuracy of 90.1% and an F1 score
of 94.8%. Significance: The method can be used to delineate
Phonocardiograms without any external reference like ECG, PPG, or
carotid Pulse. No additional signal processing overheads like noise
threshold, activity detection, or feature extraction are involved.

Keywords---Peter-Bentley PCG database, phonocardiogram, wavelets,


event detection, noise threshold.

Introduction

The phonocardiogram (PCG) signal detects and records heart sounds, the sounds
made by the various cardiac structures pulsing and moving blood [1]. This sound
is caused usually by the acceleration and deceleration of blood and turbulence
developed during the rapid blood flow [1]. An electronic stethoscope remains the
primary technology of the doctor for hearing such sounds [2]. When an electronic

International Journal of Health Sciences ISSN 2550-6978 E-ISSN 2550-696X © 2022.


Manuscript submitted: 27 March 2022, Manuscript revised: 18 May 2022, Accepted for publication: 9 June 2022
4039
4040

stethoscope is placed on the subject’s chest, the first cardiac sound (S1) and the
second cardiac sound (S2) are audible [2]. A stethoscope system consisting of an
electronic stethoscope and a digital assistant like a smartphone or a laptop is
used to assess the condition of the heart [2]. The digital assistant uses an
application based on the various types of signal processing techniques that have
been developed to analyze the condition of the heart [2]. The signal processing
technique involved in dividing the cardiac sounds into S1-S2 and S2-S1 cycles is
called segmentation [2]. Segmentation helps to assess the occurrence of cardiac
events [2]. The most popular method of cardiac sounds is the wavelet transform
[3,4]. Dinesh Kumar et al. performed segmentation of the cardiac sounds by using
the wavelet decomposition simplicity filter [3,4]. In the early years, various
threshold-based techniques based on Shannon Energy, S-transform, and Wavelet
transform were used to segment the Phonocardiograms [5-12]. In the later years,
statistical models based on HMM, HSMM, GMM, and SVM referred HSMM were
used to segment the Phonocardiograms [13-17]. Of late, classifier-based methods
using SVM, ANN, CNN, and deep neural networks have been used to segment
Phonocardiograms with good accuracy [18-22]. One of the main drawbacks of the
classifier-based methods is their reliance on the feature extraction or activity
detection mechanism which is required for PCG delineation [22]. We have
developed a simple Spectrogram based method involving a 2D-Continuous
Wavelet Transform (CWT) that can detect the boundaries of the cardiac events.
Fast Fourier transform has been utilized to identify the beats. No additional signal
processing overheads like noise threshold, activity detection, or feature extraction
are involved.

Segmentation of Phonocardiograms

The segmentation of PCG signal using CWT is divided into 5 steps namely
preprocessing, CWT computation, evaluation of wavelet energy, boundary
extraction, and S1-systole-S2-diastole identification. Each of them is explained
explicitly in the sections given below.

Preprocessing

The Phonocardiogram signal is first down-sampled from 44100 Hz to 441 Hz to


reduce the sample size by 100 times. The sampled signal is further filtered using
a Chebyshev Type II bandpass filter with a cut-off frequency of 20Hz-160Hz to
remove most of the noise redundant in the signal. Filtering the signal removes
unwanted perturbations and smoothens the signal. Fig 1 shows the original raw
signal in pane 1 and the filtered signal in pane 2. Fig 2 shows the zoom plot of Fig
1.
4041

Fig 1 Original and Filtered PCG signal

Fig 2 Original and Filtered PCG signal (zoom plot)

CWT Computation

The Continuous Wavelet transform of the filtered PCG signal is then computed
after removing the noise. Morlet wavelet is used as the mother wavelet for CWT
computation. The Morlet wavelet was selected because of its morphological
resemblance of the wavelet with the PCG signal. Matlab CWT function is used to
4042

compute the Continuous wavelet transform. The CWT Coefficient matrix


𝑪𝑴 (𝒂, 𝒃)was estimated as

𝑪𝑴 (𝒂, 𝒃) = ∫−∞ 𝒙(𝒕)𝝍𝒂.𝒃 (𝒕). (1)

Fig 3 CWT Spectrogram

Fig 4 CWT Spectrogram (Zoomed Plot)

Where 𝒙(𝒕) is the PCG and 𝝍𝒂.𝒃 (𝒕) represents the mother wavelet (Morlet) with
scale 𝒂 dilation 𝒃. Fig 3 represents the CWT spectrogram of the normal PCG
signal. Fig 4 represents the zoomed plot.

Evaluation of Wavelet Energy

Evaluation of CWT coefficients of the filtered signal results in CWT matrix. The
row sum of the CWT matrix is computed to obtain the wavelet energy. Fig 5 Pane
1 indicates the wavelet energy. The wavelet energy signal contains many sharp
spikes. These spikes are smoothened using the moving average filter. The window
4043

size of the filter is arbitrarily fixed at 10 to obtain optimum smoothness. The


wavelet energy signal is computed as

𝑾𝑬 (𝒕) = ∑ 𝑪𝑴 (𝒂, 𝒃) (2)


Where, 𝑪𝑴 (𝒂, 𝒃) represents the CWT coefficients. The wavelet energy signal is
smoothened by the moving-average filter. The moving average filter is defined as

∑𝑾
𝑴𝑨 = 𝑬
. (3)
𝒏
𝑾𝑬 represents the data points and 𝒏 represents the total number of data points.
Fig 5 Pane 2 indicated the wavelet energy signal after smoothening.

Boundary Extraction

After smoothening the signal in step 3 the mean value of the smoothened wavelet
energy signal is computed. The mean value is then subtracted from the
smoothened wavelet energy signal to obtain the corrected smoothened wavelet
energy signal with a zero line as the reference axis. The zero crossings of the
corrected smoothened wavelet energy signal with the zero-reference line are
noted. The zero crossings indicate the boundaries of the sounds in the PCG
signal.

S1-systole-S2- diastole identification

The Fast Fourier Transform of the sounds within the boundaries is computed.
Generally, the first heart sound has frequency components in the range 30Hz-
150Hz, while the second heart sound has frequency components in the range
200Hz-280Hz [22]. So, by using these metrics we have identified the heart sounds
as S1-systole-S2-diastole. Fig 5 pane 3 shows the Segmented sounds in the
smoothened wavelet energy signal. Fig 6 shows the zoomed plot. Fig 7 shows the
original segmented PCG signal and Fig 8 shows the zoomed plot. The red color
indicates the S1 sound while the pink color indicated the S2 sound as per sound
identification done using Fast Fourier Transform.

Fig 5 Wavelet Energy Signal


4044

Fig 6 Wavelet Energy Signal (Zoom Plot)

Fig 7 Segmented PCG Signal


4045

Fig 8 Segmented PCG Signal (zoomed plot)

Results and Discussion

This section describes the results obtained from applying the CWT-based
segmentation on PCG signals from the Peter Bentley PCG database.

Dataset

Two datasets were provided for the Peter Bentley PCG segmentation challenge
[23]. Dataset A comprises data crowd-sourced from the general public via the
stethoscope Pro iPhone app [23]. Dataset B comprises data collected from a
clinical trial in hospitals using the digital stethoscope Digi-Scope [23]. The audio
files are of varying lengths, between 1 second and 30 seconds (some have been
clipped to reduce excessive noise and provide the salient fragment of the sound).
Most information in heart sounds is contained in the low-frequency components,
with noise in the higher frequencies [23]. It is common to apply a low-pass filter at
4046

160 Hz [23]. Fast Fourier transforms are also likely to provide useful information
about volume and frequency over time [23].

Segmentation of PCG

The cardiac sounds are selected from the PCG Peter Bentley database. The PCG
signals are first preprocessed by down-sampling 100 times from a sampling
frequency of 44100 Hz to 441 Hz and then filtered by a Type II Chebyshev
bandpass filter with a cut-off frequency of 20 Hz to 160 Hz. CWT segmentation
procedure is then applied to the filtered sounds. In the segmentation procedure,
the CWT matrix is computed first. Then the wavelet energy is found from the CWT
matrix by taking the row-sum. The wavelet energy signal is smoothened by a
moving-average filter with a window size fixed at 10. The mean value of the
smoothened signal is then evaluated by taking the average of the samples. The
mean value is then subtracted from the original smoothened signal to obtain the
corrected smoothened wavelet energy signal. The zero-reference line of the
corrected smoothened wavelet energy signal is used to extract the boundaries of
the PCG. The zero crossings of the corrected smoothened wavelet energy signal
are noted. The sounds within the boundary are either the first heart sound or the
second heart sound. The Fast Fourier Transform is evaluated for the sounds
within the boundary. Fast Fourier Transform is a plot of frequency versus wavelet
energy. The sounds with a lesser frequency range are marked as the first heart
sound while those with higher frequencies are marked as the second heart sound.
We have effectively used Fast Fourier Transform for labeling the occurrence of S1-
systole-S2-diastole in the PCG signal.

The segmentation algorithm is applied to both datasets A and B. Both the


datasets have 4 categories of sounds namely Normal, Murmur, Extrasystole, and
Artifact. Apart from that, they have a separate set of unlabeled sounds in datasets
A and B. Fig 9 shows the original segmented normal PCG and the zoomed plot in
Fig 10. The plot shows silence in the systole and diastole. Fig 11 shows the
original segmented diastolic murmur PCG and its zoom plot in Fig 12. The
murmur sounds are visible in the diastole. Fig 13 shows the original segmented
Extrasystole PCG and its zoom plot in Fig 14. The extra sounds are visible here
that corresponds to clicks and snaps. Fig 15 and zoomed plot Fig 16 shows the
unlabeled PCG signal with its heart sound components. The figure shows a large
S1 sound with a small S2 sound.

Tables 1-6 give the split-up of the metrics obtained by applying the segmentation
algorithm. All together 643 PCG signals were involved of which 134 signals were
from dataset A while the remaining 509 signals were from dataset B. Ten percent
of the signals were rejected due to the presence of high noise and murmurs which
could not be removed even after filtering. Out of the retained 580 PCG signals,
121 signals were considered from dataset A while 459 signals were considered
from dataset B. Both dataset A and dataset B have signals under the category of
Normal, Murmur, Extrasystole, and Unlabeled sounds. In dataset A, the
segmentation procedure yielded 909 true positive S1 and S2 sounds from all
categories. 62 sounds were categorized as false positives due to bad segmentation.
28 sounds were categorized as false negatives with no segmentation. In dataset B,
segmentation procedure yielded 4182 true positive S1 and S2 sounds from all
4047

categories. 349 sounds were categorized as false positives due to bad


segmentation. 118 sounds were categorized as false negatives with no
segmentation. Considering the full database of sounds, segmentation procedure
yielded 5091 true positive S1 and S2 sounds from all categories. 411 sounds were
categorized as false positives due to bad segmentation. 146 sounds were
categorized as false negatives with no segmentation.

Sounds TP FP FN
Normal 213 15 5
Murmur 331 10 11
Extrasystole 74 20 1
Unlabeled 291 17 11
Total 909 62 28
Table 1 True Positive, False Positive and False Negative of the various PCG sounds
(dataset A)

Sounds Accuracy Positive Predictive Sensitivity F1 measure


(Ac) Value (𝑃+) (Se)
Normal 91.4 93.4 97.7 95.5
Murmur 94.0 97.1 96.8 96.9
Extrasystole 77.9 78.7 98.7 87.6
Unlabeled 91.2 94.5 96.4 95.4
Total 90.9 93.6 97.0 95.3
Table 2 PCG signal (dataset A) Metrics (Accuracy, Positive Predictive Value,

Sounds TP FP FN
Normal 2223 78 75
Murmur 273 48 1
Extrasystole 459 88 13
Unlabeled 1227 135 29
Total 4182 349 118
Sensitivity and F1 Measure)
Table 3 True Positive, False Positive and False Negative of the various PCG sounds
(dataset B)

Sounds Accuracy Positive Predictive Sensitivity F1 measure


(Ac) Value (𝑃+) (Se)
Normal 93.6 96.7 96.6 96.6
Murmur 84.8 85 99.6 91.7
Extrasystole 81.9 83.9 97.2 90
Unlabeled 88.2 90 97.7 94.8
Total 90 92.3 97.3 94.7
Table 4 PCG signal (dataset B) Metrics (Accuracy, Positive Predictive Value,
Sensitivity and F1 Measure)

Sounds TP FP FN
Normal 2436 93 80
4048

Murmur 604 58 12
Extrasystole 533 108 14
Unlabeled 1518 152 40
Total 5091 411 146
Table 5 True Positive, False Positive and False Negative of the various PCG sounds
(overall dataset)

Sounds Accuracy Positive Predictive Sensitivity F1 measure


(Ac) Value (𝑃+) (Se)
Normal 93.4 96.3 96.8 96.5
Murmur 89.6 83.2 97.4 89.7
Extrasystole 81.4 91.2 98 94.5
Unlabeled 88.8 90.0 97.4 93.6
Total 90.1 92.5 97.2 94.8
Table 6 PCG signal (overall dataset) Metrics (Accuracy, Positive Predictive Value,
Sensitivity and F1 Measure)

Fig 9 Segmented Normal PCG Signal


4049

Fig 10 Segmented Normal PCG Signal (zoomed plot)

Fig 11 Segmented Diastolic Murmur PCG Signal


4050

Fig 12 Segmented Diastolic Murmur PCG Signal (zoomed plot)

Fig 13 Segmented Extrasystole PCG Signal


4051

Fig 14 Segmented Extrasystole PCG Signal (zoomed plot)

Fig 15 Segmented Unlabeled PCG Signal


4052

Fig 16 Segmented Unlabeled PCG Signal (zoomed plot)

Conclusion

From the above results and discussion, it is evident that the PCG signal can be
segmented by the CWT technique. We have achieved an accuracy of 90.1% and an
F1 score of 94.8%. for both the datasets A and B. This segmentation procedure is
a simple technique that involves no overheads like noise threshold, activity
detection or feature extraction. The technique can be incorporated into the
stethoscope system connected to a laptop or a smartphone. The computational
efficiency is high and the cost of implementation is low.

Conflicts of Interest: None


Funding: None
Ethical Approval: Not required

References

1. Gerald Goodman, “Clinical Engineering Handbook”, Elsevier, 2004.


2. Shervegar et al., “Automatic segmentation of Phonocardiogram using the
occurrence of the cardiac events”, Informatics in Medicine Unlocked, Elsevier,
Vol 9, No 1, 2017.
3. Gupta CN, Palaniappan R, Swaminathan S, Krishnan SM. Neural network
classification of homomorphic segmented heart sounds. Appl Soft Comput
2007; 7:286–97.
4. Kumar D, Carvalho P, Antunes M, Henriques J, Maldonado M, Schmidt R, et
al., “Wavelet transform and simplicity-based heart murmur segmentation”,
Computing in Cardiology, 2006;33:173–6.
5. H.Liang et al., “Heart sound segmentation algorithm based on heart sound
envelogram,” in Proc. Comput. Cardiol., Lund, Sweden, 1997, vol. 24, pp.
105–108.
4053

6. H. Liang et al., “A heart sound segmentation algorithm using wavelet


decomposition and reconstruction,” in Proc. 19th Annu. Int. Conf. IEEE Eng.
Med. Biol. Soc., Chicago, IL, USA, 1997, vol. 4, pp. 1630–1633.
7. D. Kumar et al., “Detection of S1 and S2 heart sounds by high-frequency
signatures.” in Proc. 28th Annu. Int. Conf. IEEE Eng. Med. Biol. Soc., New
York, NY, USA, 2006, vol. 1, pp. 1410–1416.
8. S.Ariet al., “A robust heart sound segmentation algorithm for commonly
occurring heart valve diseases.” J. Med. Eng. Technol., vol. 32, no. 6, pp.
456–65, Jan. 2008.
9. J. Vepa et al., “Segmentation of heart sound using simplicity features and
timing information,” in Proc. IEEE Int. Conf. Acoust., Speech Signal Process.,
Las Vegas, NV, USA, 2008, pp. 469–472.
10. C.Gupta et al., “Neural network classification of homomorphic segmented
heart sound,” Appl. Soft Comput., vol. 7, no. 1, pp. 286–297, Jan. 2007.
11. T. Chen et al., “Intelligent heart sound diagnostics on a cellphone using a
hands-free kit,” in Proc. AAAI Spring Symp. Artif. Intell. Dev., Stanford
University, Stanford, CA, USA, 2010, pp. 26–31.
12. T. Oskiper and R. Watrous, “Detection of the first heart sound using a time-
delay neural network,” in Proc. IEEE Comput. Cardiol., Memphis, TN, USA,
2002, pp. 537–540.
13. D. Gill, N. Gavrieli, and N. Intrator, “Detection and identification of heart
sound using homomorphic envelogram and self-organizing probabilistic
model,” in Computers in Cardiology, 2005, pp. 957–960.
14. Y.-J. Chung, Pattern Recognition and Image Analysis, Iberian Conference.
Berlin, Heidelberg: Springer Berlin Heidelberg, 2007, Classification of
Continuous Heart Sound Signals Using the Ergodic Hidden Markov Model,
pp. 563–570.
15. S. Schmidt, C. Holst-Hansen, C. Graff, E. Toft, and J. J. Struijk,
“Segmentation of heart sound recordings by a duration-dependent hidden
Markov model,” Physiological measurement, vol. 31, no. 4, pp. 513–529,
2010.
16. D. B. Springer, L. Tarassenko, and G. D. Clifford, “Support vector machine
hidden semi-Markov model-based heart sound segmentation,” In Computing
in Cardiology Conference (CinC), 2014, Sept 2014, pp.625–628.
17. Springer et al., “Logistic regression-HSMM-based heart sound segmentation,”
IEEE Trans. Biomed. Eng., vol. 63, no. 4, pp. 822–832, 2016.
18. J. Vepa, “Classification of heart murmurs using cepstral features and
support vector machines,” in IEEE EMBC, 2009, pp. 2539–2542.
19. T. Leung, P. White, W. Collis, E. Brown, and A. Salmon, “Classification of
heart sounds using time-frequency method and artificial neural networks,” in
IEEE EMBC, 2000, pp. 988–991.
20. T.-E. Chen, S.-I. Yang, L.-T. Ho, K.-H. Tsai, Y.-H. Chen, Y.-F. Chang, Y.-H.
Lai, S.-S. Wang, Y. Tsao, and C.-C. Wu, “S1 and S2 heart sound recognition
using deep neural networks,” IEEE Trans. Biomed. Eng., vol. 64, no. 2, pp.
372–380, 2017.
21. Francesco Renna, Jorge Oliveira, Miguel T. Coimbra, “Convolutional Neural
Networks for Heart Sound Segmentation”, European Signal Processing
Conference (EUSIPCO 2018).
22. Brusco and Nazarene, “Digital Phonocardiography-A PDA based approach”,
Annual International Conference of the IEEE Engineering in Medicine and
4054

Biology Society. IEEE Engineering in Medicine and Biology Society.


Conference 3:2299-302, 2004.
23. Website of PCG database (Accessed 08th April 2022): www.peterjbentley.com.
24. Rinartha, K., & Suryasa, W. (2017). Comparative study for better result on
query suggestion of article searching with MySQL pattern matching and
Jaccard similarity. In 2017 5th International Conference on Cyber and IT
Service Management (CITSM) (pp. 1-4). IEEE.
25. Rinartha, K., Suryasa, W., & Kartika, L. G. S. (2018). Comparative Analysis of
String Similarity on Dynamic Query Suggestions. In 2018 Electrical Power,
Electronics, Communications, Controls and Informatics Seminar (EECCIS) (pp.
399-404). IEEE.

You might also like