Coherence Function and Adaptive Noise Cancellation Performance of an Acoustic Sensor System for Use in Detecting Coronary Artery Disease

Adaptive noise cancellation is a useful linear technique to attenuate unwanted background noise that cannot be removed using traditional frequency-selective filters. Usually, this is due to the signal and noise co-existing in the same frequency band. This paper tests a weighted least mean squares (WLMS) algorithm on a stethoscope system for use in detecting coronary artery disease in the presence of background noise. Each stethoscope is equipped with two microphones: one used to detect heart signals and one used to detect background noise. The WLMS method was used for four different sources of background noise whilst measuring a heartbeat, including a single tone, multiple tones, hospital/clinic noise, and breathing noise. The magnitude-squared coherence between both microphones was unity for the tone scenarios, resulting in complete attenuation. For the other background noise sources, a less-than-unity magnitude-squared coherence resulted in minor and no attenuation. Thus, the coherence function is a tool that can be used to predict the amount of attenuation achievable by linear adaptive noise-cancellation techniques, such as WLMS, as presented in this article.


Introduction
Heart auscultation-the interpretation of heart sounds by a physician-is a common method utilised for cardiac diagnosis [1]. Many physicians are documented to have poor auscultatory skills due to their difficulty to acquire, yet it remains the primary method used for diagnosis and screening in primary healthcare [2][3][4]. The leading cause of mortality and morbidity in the world is cardiovascular disease, contributing 31% towards all global deaths in 2019 according to the World Health Organisation [5]. This is particularly worrisome for low-to-middle-income countries where high-quality diagnostics are difficult to obtain [6]. To address this large and complex problem, there is a global need for the affordable prescreening of coronary artery disease (CAD).
Data quality will be a limiting factor in the achievable accuracy of any classification technique of CAD. Signal corruption from unwanted noise will limit data quality. In the available public datasets of normal and abnormal heartbeats, noise limits the accuracy achievable by machine learning and classifiers [7], with frequency-selective filtering being the only technique used to reduce noise. Thus, cancelling noise in the frequency band of interest is a crucial stage in acquiring data and has been implemented in the field of biomedical signals [8][9][10]. A comprehensive review of adaptive filters for noise cancellation in [11] identified existing methods derived from the least mean squares (LMS) method, highlighting it as a preferred method for noise cancellation due to its robustness and simplicity. This study shows that these techniques can be implemented on a digital stethoscope with background-noise-sensing capability and is preliminary to future classification stud-ies. A weighted least mean squares (WLMS) adaptive filter algorithm is implemented in this study . A system has been developed that incorporates six digital stethoscopes onto a wearable vest that simultaneously measures heartbeat signals and uses machine learning methodologies to pre-screen for CAD. Each stethoscope, shown in Figure 1, has two microphones. The first microphone is the heart-sensor microphone (HM) and is located behind the diaphragm. The second microphone is the background-noise microphone (BNM) located at the other end of the stethoscope. The assumption is that the HM will pick up the heart signal plus part of the background noise, and that the BNM will pick up just the background noise. Using the two-microphone configuration, it is hypothesised that the background noise can be reduced from the heart-sensor microphone. This will contribute to successful diagnosis techniques, as acquired signals from the system will be cleaner with higher signal integrity. The coherence function is the measure of the causal relationship between two signals with the presence of other signals [12] and is utilised in this paper to predict the attenuation of the background noise in the HM signal. Using a single tone whilst measuring a heartbeat, we tuned a WLMS adaptive filter algorithm to achieve complete attenuation from the HM. The parameters from this exercise were then used in this study and tested on other noise sources.

Background
Background noise can couple into the HM and corrupt acoustic heartbeat measurements. This can decrease signal integrity, as it cannot be filtered out using conventional frequency-selective filters if the noise lies within the frequency band of interest of 25-250 Hz [13]. To attenuate unwanted background noise or enhance the desired signal, adaptive filtering techniques and other non-linear techniques can be utilised.

Adaptive Noise Cancellation
Noise cancellation via a Wiener filter is a linear process, where the data are assumed to be linear-time-invariant (LTI). As explained in [14], a (p − 1)st-order Wiener filter, given by Equation (1), can be derived, which produces the minimum mean-square estimate (MMSE) of a given process d(n) by filtering a statically related process x(n) that has unwanted noise. The output of the filterd(n) is the convolution of w(n) and x(n) given by Equation (2).
Here, we assume that the auto-correlation functions r x (k) = E[x(n)x(n + k)] and r d (k) = E[d(n)d(n + k)] and the cross-correlation r dx (k) = E[d(n)x(n + k)] are known. The Wiener coefficients are calculated to minimize the mean-square error given by Equation (3).
Minimizing Equation (3) derives the Winer-Hopf equations, shown in Equation (4): where w represents the filter coefficients, and R x is a p × p Hermitian Toeplitz matrix of auto-correlations [14]. A signal-and noise-cancellation model is shown in Figure 2.
The desired heartbeat signal to be measured, d(n), is corrupted by various background noise sources, v(n), to produce the signal measured by the HM, Without any information about v 1 (n), it is not possible to remove it from d(n). The BNM measures the noise sources directly, depicted as v 2 (n); however, the two sensors do not detect the noise the same way (v 1 (n) = v 2 (n)), meaning the desired signal cannot be yielded via a direct subtraction [9]. Instead, a Wiener filter produces an estimate of v 1 (n), denoted asv 1 (n), via the observational measurements of v 2 (n). This estimate is subtracted from x(n) to attenuate the background noise. Here, the Wiener-Hopf equations are given by Equation (5).
Using a secondary sensor for noise cancellation. Adapted from [14].
In environments where the noise source is constantly changing, adaptive filters are needed that update the filter coefficient w in Equation (5) in real time. An adaptive filter model is shown in Figure 3.
Here, the output of the adaptive filter aims to minimise the MSE of estimating v 1 (n); thus, e(n) is the MSE of the desired signal d(n). The optimum filter coefficients that minimise this error are found by solving Equation (5), which can be difficult, as they constantly change for each value of n. To simplify this requirement, the form of Equation (6) can be utilised to update the filter coefficients at each time n.
Here, the filter coefficient w at time n is corrected by ∆w n to form a new set of coefficients, w n+1 , at time n + 1. Defining how this correction is to be applied is at the heart of adaptive algorithms.

Coherence Function
The coherence between the HM and BNM channels indicates how much noise can be attenuated at particular frequencies and is a measure of the accuracy between the assumed linear channels [12]. As derived in [15], the coherence function, sometimes referred to as the coherence-squared function, may be defined by Equation (7): where S vx ( f ) is the cross-spectral density, and S vv ( f ), S xx ( f ) are the auto spectral densities, which are assumed to exist. This is valid for all frequencies f and is bounded by the condition: If we apply this ideology to a noise-free LTI system governed by where h(t) is the system impulse response, and * denotes the convolution, or where H( f ) is the transfer function, the auto-and cross-spectral densities are governed by Equations (9) and (10): Here, γ 2 vx ( f ) = 1 and S vv ( f ) and S xx ( f ) = 0 for any frequency. If a heartbeat signal is introduced in We can model this system as a linear system, shown in Figure 4, to deduce if there is a linear relationship between v(t) and x(t). The true system is modelled by Equation (11), and the model is obtained by minimising the error given by Equation (12).
The MMSE method is a standard way to achieve this in the time or frequency domain. The frequency domain MMSE method is as follows.
Here, X T ( f ) andX T ( f ) are the frequency-domain representation of x(t) andx(t), respectively. Taking the derivative of Equation (13) with respect toĤ * yields: implying: Here, we assumed that E(dv) = 0, resulting in R dv ( f ) = 0. We see that, for this scenario, the coherence function is given as: thus, which connects the LTI noise-cancellation approach to the coherence function. One of the major problems encountered when applying adaptive noise-cancellation techniques in real acoustic environments was the low coherence between the noise signal corrupting the desired signal and the noise sensor [16]. For the scenario depicted in Figure 2, a coherence value less than unity indicates that the system relating x and v 2 is not linear [15], thus the noise at those particular frequencies cannot be completely removed. The amount of possible noise cancellation for this scenario as a function of frequency, R(ω), is given by Equation (18) and plotted in Figure 5 [16].

Literature Survey
An adaptive filter has four main aspects, as stated in [17]: the signal, the structure, the parameters, and the adaptive algorithm. The signal is processed by the filter, the structure relates the output signal computed from the input signal, the parameters alter the input-output relationship iteratively, and the adaptive algorithm describes how these parameters are changed over time. Adaptive noise cancellation is an application of adaptive filtering that has been studied vastly in the literature [11], with the theory being explained throughout Section 2. Research in this area dealing with bio-signals has grown over the recent years, in particular due to the filtering of EEG and ECG signals that are corrupted by line interference [18,19]. The following part of this research discusses studies that directly apply to enhancing bio-generated sounds in electronic stethoscopes.
Cancelling environmental noise from cardiac sounds was investigated by Giustina et al. using a multi-channel adaptive algorithm [9]. Sound acquired from two microphones was used to reconstruct the transfer function of a stethoscope head allowing distortionless noise reduction. The first microphone was placed in a pipe directly connected to the stethoscope head, and the second microphone was placed in an adjacent pipe. It was experimentally verified that the inner microphone detected cardiac sounds and noise and the outer microphone detected only noise. A weighted difference (WD) adaptive algorithm was implemented and resulted in significant noise-reduction ratios (NRR) for different scenarios. In particular, a noisy office with background voices, a synthetic chirp and a high-frequency noise obtained NRRs of −14.04, −15.5 and −16.11 dB, respectively.
A similar study was conducted by Patel et al. in [10], where the aim was to attenuate simulated USAF C-130 aircraft noise whilst measuring and processing lung sounds. A twochannel stethoscope was held to a subject's right anterior upper chest while they breathed through a pneumotachograph. The two microphones, labelled x (background noise pickup microphone) and d (subject microphone), offer the same functionality as seen in [9] and the proposed stethoscope shown in Figure 1. The signals from x and d were amplified and high-pass filtered at a 100 Hz cut-off frequency, then digitized at 5120 samples per second. Some 20-s data segments were recorded during breathing for aircraft noise levels of 80, 90 and 100 dB sound pressure levels (SPL). These epochs were processed with the adaptivenoise-reduction least mean squares (LMS) and normalised least mean squares (NLMS) algorithms using MATLAB. Both of these algorithms apply Equation (6) in different ways and are explained comprehensively in [10,14]. The LMS approach achieved approximately 15 dB of noise reduction in the frequency range 100-600 Hz at 100 dB SPL. The NLMS algorithm provided faster convergence with frequencies above 450 Hz attenuated by an additional 5 dB.

System Model
This paper uses a weighted least mean squares (WLMS) algorithm to update the filter coefficients shown in Equation (6). Let the HM signal corrupted with noise be denoted as x and the BNM signal be denoted as y. For each sample from the HM, x(i), the error history is given by Equation (19): Here, y(i) = (y[i], y[i + 1], . . . , y[i + N]) T , where N is the filter length (FL). The weights of the filter were updated for each sample as per Equation (20): Here, the FL determines the size of vectors y and w, and the step size, µ, determines the size at which the filter coefficients are updated. This algorithm is a "variable leaky LMS" algorithm, which has the potential to significantly outperform the standard LMS algorithm [20].

Materials and Methods
Four different sources of background noise were tested on heartbeat measurements: a single 300 Hz tone; multiple tones consisting of 200 Hz, 300 Hz and 500 Hz ; hospital/clinic noise; and breathing noise. The tones were generated through Audacity, and the hospital/clinic noise was used from YouTube. The heartbeat measurements were of the first author and offer no diagnostic insight; thus, no ethical approval was required for this research. A FireFace UCX was used with a MATLAB interface to allow the simultaneous playback of the background noise through a Fostex 6301B speaker whilst recording from the stethoscope shown in Figure 1. The stethoscope was taped to the first author's chest, making sure that the BNM was exposed. Figure 6 displays this configuration.
Heartbeat measurements with a duration of 15 s were taken for each background noise scenario. The first author was under breath-held conditions, except for the breathing noise scenario, where the speaker was turned off. The FireFace UCX collected data at 44.1 kHz sampling frequency, which was re-sampled down to 2 kHz. Version R2022a of MATLAB was used to complete this, as well as implement the algorithm from Section 4 on a laptop (HP laptop; Processor-Intel(R) Core(TM) i7-10510U; RAM-16 GB; Operating system-Windows 10; Processor Speed-2.3 GHz).
The FL and step size µ were first tuned on the single 300 Hz tone. The combination that achieved the best attenuated signal was then used for the other background noise scenarios after comparing the performance to a conventional LMS algorithm reviewed in [11]. For each case, the coherence function between the HM and the BNM was plotted via a Welch estimation in MATLAB to indicate the expected noise cancellation performance. Power spectral density (PSD) plots and spectrograms generated through MATLAB allowed visualisation of the performance.
(a) (b) Figure 6. (a) Stethoscope taped to chest recording heartbeat with BNM exposed. (b) Background noise played through Fostex 6301B Speaker.

Results and Discussion
This section consists of four subsections each containing the results from the four tested background noise sources; a single tone, multiple tones, hospital/clinic noise, and breathing noise. As the HM and BNM were re-sampled down to 2 kHz, the x-axis and y-axis range from 0-1 kHz for coherence function and spectrogram plots, respectively.

Single 300 Hz Tone
When a single 300 Hz tone was played through the Fostex speaker, the coherence function between the HM and BNM, shown in Figure 7, displayed unity at 300 Hz. Thus, we can expect complete attenuation of the tone using linear techniques. The WLMS algorithm was tested for FL = 256, 512 and 1024. The PSD of the filtered HM signals plotted with the unfiltered HM signal is displayed in Figure 8. For each scenario, the amount of attenuation remained constant at 27 dB. A FL of 512 was selected for tuning the step size value, µ, of the WLMS algorithm. Values of 0.01, 0.05, 0.1 and 0.5 were tested, with the PSDs compared once again in Figure 9. The attenuation increased as µ increased, where almost complete attenuation (approx. 35 dB) was achieved at µ = 0.5. However, we noted that the low frequency content was affected, evident in Figure 9a, which must be investigated further. Nevertheless, this agrees with the coherence function that suggests that complete attenuation is possible. A 300 Hz tone is a periodic signal, suggesting why the measured attenuation was high. This may not be the case when other non-periodic noise sources are present.
The performance using a conventional LMS algorithm is shown in Figure 10 based on the highest-performing parameters achieved in the WLMS algorithm. The filter length was kept at 512, and the algorithm tested for µ values of 0.1 and 0.5. The maximum attenuation achieved was 32 dB, when µ was 0.5, and was not fully attenuated. The LMS algorithm under-performed our proposed WLMS algorithm, resulting in lower signal integrity that will negatively affect the classification of CAD. Thus, the following results in this section use the WLMS algorithm with FL = 512 and µ = 0.1, which was tuned in this subsection to achieve high attenuation without affecting the lowerfrequency content.

Multiple Tones
The 200 Hz, 300 Hz and 500 Hz tones were played simultaneously through the speaker, and the coherence between the HM and BNM is displayed in Figure 11. The three tones had unity magnitude-squared coherence, as well as the first harmonic of each tone. This suggests that the first two harmonics can be fully attenuated. The WLMS algorithm was tested on the scenario where each tone was played for 5 s while a heartbeat was recorded, so as to test the ability of the algorithm to adapt to different tones. Near-complete attenuation was observed in the PSD comparison of the filtered and unfiltered HM signal shown in Figure 12a, which is visually seen in the spectrogram shown in Figure 12b The 200 Hz tone lies within the signal of interest. It did not affect the heartbeat signal when attenuated, highlighting the strength of the adaptive filtering. The BNM and HM also support the hypothesis of the stethoscope design, where the BNM detects the background noise, and the HM detects the heartbeat plus the background noise. This is essential for adaptive noise cancellation, so as to not affect the signal of interest. The HM did not detect the higher-order harmonics to the same degree as the tones, suggesting the reason unity coherence was not seen in Figure 11.

Hospital/Clinic Background Noise
This type of noise can be expected when measuring heartbeats in practical situations, such as in hospitals or clinics. Thus, it is of high interest to attenuate this type of non-stationary noise within the frequency of interest. The magnitude-squared coherence between the HM and BNM, shown in Figure 13a, is not in unity for any frequency band. Between 200-500 Hz, it varies from 0.3 to 0.7. Thus, adaptive filtering will not result in the complete attenuation of the background noise. Around 3-5 dB will be possible at a magnitude-squared coherence value of 0.5. There is visual evidence of attenuation displayed in the spectrogram comparison in Figure 13b. The energy at 500 Hz and the band between 200 and 300 Hz is slightly suppressed. To increase the attenuation, applying the WLMS algorithm across separate frequency bands can be explored. A re-plot of the coherence function for each frequency band will provide a better indication of achievable suppression.

Breathing Noise
Many studies in the literature on the detection of CAD ensures that patients hold their breath whilst heartbeat measurements are taken [21][22][23]. Although this is ideal for CAD detection, extending the stethoscope system to detect lung disease could be performed in unison, where the breathing noise can contain critical information. Thus, it is of great interest to separate the heartbeat sound from the breathing sound, so they can be studied and processed separately. For this test, the first author breathed with no external background noise. Across the whole frequency band, the magnitude-squared coherence function was less than 0.3, as seen in Figure 14a. This suggests that less than 1 dB of breathing noise suppression is achievable. This was confirmed in Figure 14b, where the HM signal before and after filtering appear identical. Non-linear methods may be explored to suppress the breathing noise and enhance the heart signal. These other methods should be carefully designed, so as to not suppress murmurs that are present in CAD patients, as the diagnostic process will be negatively affected.
The spectrogram comparison between the BNM and HM is worth noting. The BNM has observed power in the phase of the recording corresponding to exhaling. This is not seen in the HM, indicating that both microphones detect the breathing sounds differently. From the HM perspective, the sound generated by the air moves through body tissue and bone from inside the body and is coupled through the diaphragm. In contrast, breathing sounds from one's mouth and nose travel through the air before being detected by the BNM. Both of these pathways have different acoustic properties, suggesting why the breathing appears differently on each spectrogram, indicating its difficulty to suppress or separate.

Summary of Results
A summary of our results and previously reported results from Section 3 is presented in Table 1.

Conclusions
In this paper, the performance of the WLMS algorithm to suppress backgroundnoise-corrupting heartbeat measurements was predicted using the coherence function and tested. When periodic signals, such as the single and multiple tones, were played as background noise, the magnitude-squared coherence between the HM and BNM was unity. Thus, we expected that full suppression was attainable and saw this by adjusting the FL and step size, µ, of the WLMS algorithm. Confidence in using this algorithm increased after it outperformed a conventional LMS algorithm on the single-tone background-noise scenario. These parameters were used for the following background noise sources and breathing noise. The magnitude-squared coherence in the hospital/clinic background noise scenario suggested that 3-5 dB noise suppression was achievable using these linear techniques, and this was evident in the spectrogram comparison. For the breathing-noise scenario, the low magnitude-squared coherence resulted in no visible suppression on the spectrogram comparison. To achieve higher attenuation in scenarios where there is low magnitude-squared coherence between the HM and BNM, linear techniques, such as the WLMS algorithm presented in this papers system model, could be applied to separate frequency bands. If this does not achieve desirable suppression, non-linear techniques can be explored.
Our tests produced comparable performance to previously reported data presented in Section 3 and Table 1. Our highest achieved attenuation arose from the scenarios when tones were the background noise source under test. The synthetic chirp and high-frequency noise produced the highest attenuation reported in [9], and the NLMS algorithm led to 20 dB attenuation for 100 dB SPL aircraft noise reported in [10]. Similar to the periodic tones, these sources are stationary, and, although coherence function analysis was not included in these studies, we can assume that there was a high magnitude-squared coherence between both microphones in each case to explain the results. The scenario in [9], where background voices were attenuated by 14.04 dB, is encouraging towards our future studies, as this was considerably higher than the hospital/clinic background noise attenuation that we measured. These are non-stationary sources, indicating our algorithm must be tuned to achieve comparable results.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author. The data are not publicly available due to privacy.