Computer-Aided Detection of Fiducial Points in Seismocardiography through Dynamic Time Warping

Accelerometer-based devices have been employed in seismocardiography fiducial point detection with the aid of quasi-synchronous alignment between echocardiography images and seismocardiogram signals. However, signal misalignments have been observed, due to the heartbeat cycle length variation. This paper not only analyzes the misalignments and detection errors but also proposes to mitigate the issues by introducing reference signals and adynamic time warping (DTW) algorithm. Two diagnostic parameters, the ratio of pre-ejection period to left ventricular ejection time (PEP/LVET) and the Tei index, were examined with two statistical verification approaches: (1) the coefficient of determination (R2) of the parameters versus the left ventricular ejection fraction (LVEF) assessments, and (2) the receiver operating characteristic (ROC) classification to distinguish the heart failure patients with reduced ejection fraction (HFrEF). Favorable R2 values were obtained, R2 = 0.768 for PEP/LVET versus LVEF and R2 = 0.86 for Tei index versus LVEF. The areas under the ROC curve indicate the parameters that are good predictors to identify HFrEF patients, with an accuracy of more than 92%. The proof-of-concept experiments exhibited the effectiveness of the DTW-based quasi-synchronous alignment in seismocardiography fiducial point detection. The proposed approach may enable the standardization of the fiducial point detection and the signal template generation. Meanwhile, the program-generated annotation data may serve as the labeled training set for the supervised machine learning.


Introduction
The emergence of wearable solutions for health monitoring provides opportunities for remote medical surveillance. Biosensing and cloud computing technologies enable physiological parameters to be tracked unobtrusively, accurately, and in real time in everyday life. In most cases, relatively simple, reproducible, and reliable generic physiological parameters are monitored. Cardiac time intervals (CTIs), durations between specific cardiac events, are closely related to cardiac physiology and function. CTIs play a pivotal role in the diagnostic and prognostic assessments of patients with hemodynamic and valve dysfunction, especially with regard to risk stratification [1,2].
In clinical practice, CTIs associated with valve opening and closure, including the pre-ejection period (PEP), left ventricular ejection time (LVET), isovolumic contraction time (IVCT), and isovolumic relaxation time (IVRT), are employed in the calculation of the myocardial health index. These CTIs describe the time periods between the specific cardiac events of mitral valve opening (MO), mitral valve closure (MC), aortic valve opening (AO), Although some of the CTIs are modulated by heart rate, respiration, or even the individual's posture and position [3,4], the cardiac indexes derived from CTIs are considered reliable parameters for predicting and assessing myocardial contractility [2,3,5]. Two frequently used cardiac indexes are the PEP/LVET ratio (also known as the contractility coefficient) [6,7] and the Tei index (also known as the myocardial performance index) [5]. They are defined as follows: Tei index = (IVCT + IVRT)/LVET.
Both the PEP/LVET ratio and the Tei index have been clinically confirmed to be heart rate-independent and negatively correlated with the left ventricular ejection fraction (LVEF) on a beat-to-beat basis [2,3,5]. Carvalho observed that individuals with normal cardiac function (higher LVEF) exhibited a short PEP and a long ejection time. By contrast, patients (lower LVEF) with reduced stroke volume (SV) and cardiac output (CO) had a longer PEP and shorter LVET [8]. Thus, CTIs and the two cardiac indexes mentioned above can supplement the LVEF and serve as proxies in the assessment of myocardial contractility [9][10][11].
Echocardiography is considered the gold standard for obtaining CTIs [8]. CTIs are typically acquired using ultrasound modalities such as color Doppler flow imaging, tissue Doppler imaging, or M-mode echocardiography [8,[12][13][14]. From echocardiography images, physicians can accurately determine the timings of the start, peak, and end of specific hemodynamic or cardio-mechanical events (e.g., blood ejection, myocardial motion, and valve opening or closure) in various phases of the cardiac cycle. However, acquiring echocardiograms is time consuming and requires the expertise of a well-trained sonographer. Therefore, for long-term, home-based cardiac monitoring, the use of comparatively simple, noninvasive wearable devices to conduct hemodynamic assessment, such as through impedance cardiography, phonocardiography, and seismocardiography (SCG), is preferred [7,10,12]. SCG, a noninvasive approach for the diagnosis of cardiac conditions, is capable of evaluating CTIs through chest wall vibration analysis. Temporal information of cardiac events can be obtained by identifying the specific fiducial points in the SCG signals corresponding to the events. Single-channel and multichannel SCG monitoring systems and SCG-echocardiography hybrid apparatuses have been proposed [7,15,16]. In 1994, Crow examined trimodal screenshots of simultaneous ECG and SCG signals and echocardiography images to investigate the relationship between SCG and echocardiographic images regarding cardiac events [16]. In the trimodal measurements, the SCG signal was routed to the auxiliary input port of the ultrasound machine and was presented synchronously on top of the echocardiogram together with the ECG signal. This enabled the SCG fiducial point detection and the CTI analysis with the same heartbeat cycle on the same ultrasound image.
Home-based cardiac monitoring requires special analytical methods because no sonographers or ultrasound instruments are available. Heterogeneous modality cooperation may serve as the alternative; that is, conducting the diagnostic assessment using ECG and echocardiogram (also assisting SCG fiducial point identification) while home monitoring using ECG and SCG. Lin et al. introduced a quasi-synchronization method for SCG fiducial point detection from the SCG and ECG data collected through the inertial-sensor-based multichannel SCG systems and from several echocardiogram images acquired at different time [7,9]. The ECG signal from SCG measurement and the ECG signal from echocardiogram image were aligned by the manipulation of uniform stretching (or squeezing) and shifting in time axis to align the ECG R peaks to each other. This approach is referred to as the quasi-synchronous alignment (or "conventional" quasi-synchronous alignment) in this paper and is illustrated in Figure 1.
Home-based cardiac monitoring requires special analytical methods because no sonographers or ultrasound instruments are available. Heterogeneous modality cooperation may serve as the alternative; that is, conducting the diagnostic assessment using ECG and echocardiogram (also assisting SCG fiducial point identification) while home monitoring using ECG and SCG. Lin et al. introduced a quasi-synchronization method for SCG fiducial point detection from the SCG and ECG data collected through the inertial-sensorbased multichannel SCG systems and from several echocardiogram images acquired at different time [7,9]. The ECG signal from SCG measurement and the ECG signal from echocardiogram image were aligned by the manipulation of uniform stretching (or squeezing) and shifting in time axis to align the ECG R peaks to each other. This approach is referred to as the quasi-synchronous alignment (or "conventional" quasi-synchronous alignment) in this paper and is illustrated in Figure 1. The development of SCG has been limited by artifact effects, the ambiguity in specific event waveforms and the lack of detection procedures; no standards for fiducial point detection in SCG signals have been established [17]. In this study, the problems of quasisynchronous alignment were revisited, and an improved SCG fiducial point detection protocol was devised by introducing a reference SCG signal and the dynamic time warping (DTW) algorithm. The new alignment method is referred to as the "DTW-based" quasi-synchronous alignment, so as to distinguish it from the existing quasi-synchronous alignment method (or the "conventional" quasi-synchronous alignment). Compared to the conventional quasi-synchronous alignment, DTW-based quasi-synchronous alignment eliminates the fiducial point detection error due to the stretching (or squeezing) manipulation. Compared to the envelope-based detection methods [14,[18][19][20], DTW-based quasi-synchronous alignment does not limit to any specific fiducial points, as long as the corresponding cardiac events could be identified in an clinical imaging modality (not limited to echocardiogram, that was used in this paper) or cardiac signal that is simultaneously measured with ECG. This method has the potential to untie the knot that limits the development of SCG. The development of SCG has been limited by artifact effects, the ambiguity in specific event waveforms and the lack of detection procedures; no standards for fiducial point detection in SCG signals have been established [17]. In this study, the problems of quasi-synchronous alignment were revisited, and an improved SCG fiducial point detection protocol was devised by introducing a reference SCG signal and the dynamic time warping (DTW) algorithm. The new alignment method is referred to as the "DTW-based" quasi-synchronous alignment, so as to distinguish it from the existing quasi-synchronous alignment method (or the "conventional" quasi-synchronous alignment). Compared to the conventional quasi-synchronous alignment, DTW-based quasi-synchronous alignment eliminates the fiducial point detection error due to the stretching (or squeezing) manipulation. Compared to the envelope-based detection methods [14,[18][19][20], DTW-based quasisynchronous alignment does not limit to any specific fiducial points, as long as the corresponding cardiac events could be identified in an clinical imaging modality (not limited to echocardiogram, that was used in this paper) or cardiac signal that is simultaneously measured with ECG. This method has the potential to untie the knot that limits the development of SCG.
As the deterministic approach in pattern recognition technology, by which machine learning was enabled in many applications [21,22], DTW is known for its capability to align the morphological patterns of two given time series (signals), its flexibility in handling signals of varying length, and its feasibility of implementation through computer programs [23]. DTW has been applied to speech recognition, time series clustering, and protein sequence alignment [24][25][26]. Herein, DTW was employed to mitigate the waveform variations in SCG signal analysis. In Azad's study, the DTW distance, instead of the Euclidean distance, significantly reduced the morphological variability in clustered SCG signals corresponding to groups of participants in various breathing stages [27]. Based on DTW alignment, an investigation on subject-oriented template generation succeeded to establish the procedures for signal clustering (by using the k-means algorithm) and averaging according to SCG morphological features for the first time [28].
The remainder of this paper is organized as follows. In Section 2, the data acquisition setup, data preprocessing procedure, and the reason for introducing the reference SCG segment are declared. The experimental results are provided in Section 3. The discussions and conclusions are presented in Section 4.

Materials and Methods
The study protocol of this work was approved by the Institutional Review Board of Chang Gung Memorial Hospital, Taoyuan, Taiwan (approval number 202100744B0A3). The physiological data (112 echocardiography images and SCG signal clips of 3876 heartbeats) of 56 individuals (30 men, 26 women) collected in the previous study by Lin [9] on a multichannel SCG spectrum system were employed in this study. The data for each individual comprised the diagnostic history, LVEF assessment, echocardiography images, ECG signals, and a set of four-channel SCG signals. In this study, only the first channel SCG data was analyzed, and the signal was recorded from the location of the fifth-left intercostal space in the midclavicular line of the mitral valve with the participant in a supine position. The echocardiogram images captured the parasternal long axis (PLAX) in the M-mode and the Doppler flow images of the mitral and aortic valves, providing the timings of valve opening and closure. Participants were instructed not to exercise before the tests. The raw SCG and ECG data underwent filtering, detrending, wavelet noise reduction, cardiac cycle identification, ECG wave annotation, and cycle segmentation [28].
The following sections introduce concepts and problems of the conventional quasi-synchronous alignment, as well as concepts and advantages of DTW-based quasi-synchronous alignment. Furthermore, a programming flowchart is presented and performed to validate the annotation procedures and the effectiveness of SCG fiducial point detection.

Conventional Quasi-Synchronous Alignment for Echocardiogram Image and SCG Signal
Although beat-by-beat synchronicity can be achieved in trimodal (echocardiography/ECG/SCG) measurements, the ultrasound probe may interfere with SCG sensors on the chest during such simultaneous measurements. Through simple shifting and rescaling (stretching or squeezing) manipulations on the record signals, the "asynchronously" measured echocardiogram images and SCG signals could be analyzed in the same graph to establish quasi-synchronization [9]. This method, which is as effective as trimodal measurement, caters to the increasing demand for the home-based monitoring for patients with cardiovascular disease and heart failure.
An example of the conventional quasi-synchronous alignment is displayed in Figure 1. To align the echocardiogram image and the SCG signal quasi-synchronously, R peaks from the two ECG signals were employed as the beacon targets. The ECG signal in Figure 1b was rescaled and shifted to align the R peaks to the ECG R peaks of the echocardiogram image (in Figure 1a) as indicated in the orange boxes. The vertical blue lines in Figure 1 link the timing information between the echocardiogram image and SCG signals. As the events visually identified in the echocardiogram image, the timing positions of the fiducial points in SCG signal could be easily obtained. Therefore, the fiducial points of the SCG signals could be detected. This technique had also been applied to color Doppler echocardiogram and tissue Doppler echocardiogram images to identify six new fiducial points [9].

Misalignmenst and Detection Errors in SCG Fiducial Point Detection under Conventional Quasi-Synchronous Alignment
Although the conventional quasi-synchronous alignment is a rapid and intuitive approach in which ECG signals from echocardiogram and SCG measurements are used as the intermedium, the rescaling manipulation can be problematic. Waveform distortion due to rescaling may result in unexpected target shifting as the signals were subjected to the conventional quasi-synchronous alignment. For easier graphic illustration and better clarification, two ECG and SCG signal pairs with different heartbeat lengths were used as examples in Figures 2-4, whereas the mostly concerned targets in this study are echocardiogram image and SCG signal. The issue exists in spite of the target change as long as the end-to-end alignment was achieved by the rescaling manipulation.
align the R peaks to the ECG R peaks of the echocardiogram image (in Figure 1a) as indicated in the orange boxes. The vertical blue lines in Figure 1 link the timing information between the echocardiogram image and SCG signals. As the events visually identified in the echocardiogram image, the timing positions of the fiducial points in SCG signal could be easily obtained. Therefore, the fiducial points of the SCG signals could be detected. This technique had also been applied to color Doppler echocardiogram and tissue Doppler echocardiogram images to identify six new fiducial points [9].

Misalignmenst and Detection Errors in SCG Fiducial Point Detection under Conventional Quasi-Synchronous Alignment
Although the conventional quasi-synchronous alignment is a rapid and intuitive approach in which ECG signals from echocardiogram and SCG measurements are used as the intermedium, the rescaling manipulation can be problematic. Waveform distortion due to rescaling may result in unexpected target shifting as the signals were subjected to the conventional quasi-synchronous alignment. For easier graphic illustration and better clarification, two ECG and SCG signal pairs with different heartbeat lengths were used as examples in Figures 2-4, whereas the mostly concerned targets in this study are echocardiogram image and SCG signal. The issue exists in spite of the target change as long as the end-to-end alignment was achieved by the rescaling manipulation. Conventional quasi-synchronous alignment by stretching the short-period signal: (a) Long-period (red), short-period (blue), and stretched short-period (black dashed) ECG signals; (b) Long-period (red), short-period (blue), and stretched short-period (black dashed) SCG signals with fiducial points and the detection error indicators (white arrows). Figure 2 demonstrates the conventional quasi-synchronous alignment involving the stretching manipulation of short-period ECG and SCG signals such that they were matched end to end with long-period signals. Figure 3 displays the same alignment approach but performed by squeezing the long-period signals such that they were matched end to end with the short-period signals. The principal problem of the conventional quasisynchronous alignment is applying a unique rescaling ratio (stretching or squeezing scale ratio) to the entire waveform. The unique rescaling ratio manipulation is suspicious as all the fiducial points (MO, MC, AO, and AC) of the short-period signal (blue line) in Figures  2 and 3 are very close to the corresponding fiducial points in the long-period signal (red line). Over both the short and long period heartbeats, the heart pulsed at a comparable Figure 2. Conventional quasi-synchronous alignment by stretching the short-period signal: (a) Longperiod (red), short-period (blue), and stretched short-period (black dashed) ECG signals; (b) Longperiod (red), short-period (blue), and stretched short-period (black dashed) SCG signals with fiducial points and the detection error indicators (white arrows). Figure 2 demonstrates the conventional quasi-synchronous alignment involving the stretching manipulation of short-period ECG and SCG signals such that they were matched end to end with long-period signals. Figure 3 displays the same alignment approach but performed by squeezing the long-period signals such that they were matched end to end with the short-period signals. The principal problem of the conventional quasi-synchronous alignment is applying a unique rescaling ratio (stretching or squeezing scale ratio) to the entire waveform. The unique rescaling ratio manipulation is suspicious as all the fiducial points (MO, MC, AO, and AC) of the short-period signal (blue line) in Figures 2 and 3 are very close to the corresponding fiducial points in the long-period signal (red line). Over both the short and long period heartbeats, the heart pulsed at a comparable pace in the beginning (before 600 ms). Overall, length and morphology differences were noted in the heartbeat signals; this is attributed to the deviation in the signal length caused by the unequal cardiac paces in the latter portion of the cycle (after 600 ms). The widths of the yellow bars in Figure 2b and b represent the variations in SCG fiducial point timings between the short-and long-period signals before the rescaling manipulation, which are ≤10 ms. chronous alignment led to different detection errors for different fiducial points. This is owing to the signal morphological distortion as the left end is fixed while applying a unique rescaling ration to the entire signal to make the right end match that of another signal with a different length. Likewise, if the SCG fiducial points detected from the SCGechocardiogram alignment adopt the conventional quasi-synchronous approach, the same signal distortion and detection errors will occur. That will degrade the CTI assessment and the diagnostic applications of SCG.  Figure 4 illustrates two ECG and SCG waveforms with the same heart cycle period spontaneously aligning to each other, not only in the former half section but also in the latter half section. This phenomenon (the comparable heart pace and self-alignment in morphology over the entire heart cycle) was leveraged in the proposal of this study (a new Three types of lines (red solid, blue solid, and black dashed) annotated with four types of icons (squares, triangles inverted triangles, and circles) are shown in Figures 2b and 3b. The icons and lines presented in blue and red correspond to the pre-detected fiducial points and SCG signals for the short-and long-period heartbeats, respectively. Figure 2b illustrates the distorted signal (black dashed curve) and timing push off in fiducial points (black icons) ascribable to the uniform stretching process (indicated by the sign of blue rightwards arrow). The amounts of detection error for the four fiducial points are indicated by the lengths of the white arrows. Similar detection errors of the fiducial points are observable in Figure 3b, whereas the long-period signal is squeezed to match the short-period signal. The white arrows are with the lengths (of several tens milliseconds) considerably longer compared to the widths of the yellow bars, and with a trend that the longer arrows appear closer to the right end. The trend reveals that the conventional quasi-synchronous alignment led to different detection errors for different fiducial points. This is owing to the signal morphological distortion as the left end is fixed while applying a unique rescaling ration to the entire signal to make the right end match that of another signal with a different length. Likewise, if the SCG fiducial points detected from the SCGechocardiogram alignment adopt the conventional quasi-synchronous approach, the same signal distortion and detection errors will occur. That will degrade the CTI assessment and the diagnostic applications of SCG. Figure 4 illustrates two ECG and SCG waveforms with the same heart cycle period spontaneously aligning to each other, not only in the former half section but also in the latter half section. This phenomenon (the comparable heart pace and self-alignment in morphology over the entire heart cycle) was leveraged in the proposal of this study (a new quasi-synchronous alignment method) to avoid the signal distortion and to mitigate the misalignments in SCG fiducial point detection. For this reason, a reference SCG signal was introduced as the intermediary to accommodate the fiducial points detected from the alignment to echocardiogram images and also to project the fiducial points to other nonreference SCG signals.

Introduction of Reference Signal in Quasi-Synchronous Alignment
quasi-synchronous alignment method) to avoid the signal distortion and to mitigate the misalignments in SCG fiducial point detection. For this reason, a reference SCG signal was introduced as the intermediary to accommodate the fiducial points detected from the alignment to echocardiogram images and also to project the fiducial points to other nonreference SCG signals. To avoid the waveform distortion during the signal alignment, a reference signal pair of ECG and SCG were screened out from the SCG measurements which had the heart cycle period closest to that of the ECG signal in the echocardiogram image. In Figure 5, a reference signal pair example is illustrated, both the selected RR intervals of the ECG signals in echocardiogram ( Figure 5a) and the RR intervals in the reference signal pair ( Figure  5b) are the same (966 milliseconds). As the RR interval of the reference ECG signal performing end-to-end alignment with the echocardiogram ECG, no rescaling manipulation was needed. In addition, the entire ECG and SCG signals were considered synchronous to the selected cycle in the echocardiogram on the premise of spontaneous alignment discussed in Figure 4. The aortic valve closing event (annotated by "AC" in Figure 5) identified in the echocardiogram, was mapped to the same temporal place in the reference ECG and SCG signals. The reference SCG signal with fiducial points mapped from the echocardiogram was then used as the intermediary template signal for fiducial point projection to other nonreference measurements. The projection process based on the DTW algorithm, which takes signal morphological similarity into consideration. The revised quasi-synchronous alignment method hereinafter referred to as DTW-based quasi-synchronous alignment. To avoid the waveform distortion during the signal alignment, a reference signal pair of ECG and SCG were screened out from the SCG measurements which had the heart cycle period closest to that of the ECG signal in the echocardiogram image. In Figure 5, a reference signal pair example is illustrated, both the selected RR intervals of the ECG signals in echocardiogram ( Figure 5a) and the RR intervals in the reference signal pair (Figure 5b) are the same (966 milliseconds). As the RR interval of the reference ECG signal performing end-to-end alignment with the echocardiogram ECG, no rescaling manipulation was needed. In addition, the entire ECG and SCG signals were considered synchronous to the selected cycle in the echocardiogram on the premise of spontaneous alignment discussed in Figure 4. The aortic valve closing event (annotated by "AC" in Figure 5) identified in the echocardiogram, was mapped to the same temporal place in the reference ECG and SCG signals. The reference SCG signal with fiducial points mapped from the echocardiogram was then used as the intermediary template signal for fiducial point projection to other nonreference measurements. The projection process based on the DTW algorithm, which takes signal morphological similarity into consideration. The revised quasi-synchronous alignment method hereinafter referred to as DTW-based quasi-synchronous alignment.

DTW
DTW, a dynamic programming base algorithm, has been applied to the speech recognition analysis with the identical voice content but morphologically varied at different speech paces [29]. The flexibility of DTW algorithm in aligning two sequences (not necessarily equal in data length) extends its application from speech recognition to biometrics (e.g., fingerprints), handwriting and many other technological fields [30].

DTW
DTW, a dynamic programming base algorithm, has been applied to the speech recognition analysis with the identical voice content but morphologically varied at different speech paces [29]. The flexibility of DTW algorithm in aligning two sequences (not necessarily equal in data length) extends its application from speech recognition to biometrics (e.g., fingerprints), handwriting and many other technological fields [30].
Given two morphologically similar signal sequences, X = (x 1 , x 2 ,..., x M ) of length M (M ∈ N) and Y = (y 1 , y 2 , . . . , y N ) of length N (N ∈ N), the goal of the DTW algorithm is to align X and Y to optimize distance cost function requirements as well as to conform to the warping path constraints of (1) monotonicity, (2) continuity, (3) boundary, (4) warping window, and (5) slope constraints [31,32]. A cost matrix with size of M × N was constructed to present all possible path points of the dynamic warping. Given a path W = (w 1 , w 2 ,..., w K ) of length K, max(M,N) ≤ K ≤ M + N − 1. Any w i in W contains two index elements, w i = (a i , b i ), with the first and second indexes corresponding to the a i th and b i th elements from X and from Y, respectively. Figure 6a illustrates the matrix grids of possible path steps and the aligned warping path for two sequences. Figure 6b shows the point-to-point mapping of the aligned signal sequences. The iterative dynamic planning process drove the warping path W gradually close to the optimized path as the distance cost function was tuning to the minimum scenario. Typically, the DTW distance cost function is defined as follows: Biosensors 2022, 12, x FOR PEER REVIEW 9 of 20 Some DTW applications concern only the Euclidean distance of the aligned points in the signal sequences (as in Equation (7)), whereas in the present study, the morphological similarity was most interested in and critical to fiducial point projection. A hybrid form of the cost function (termed the new cost function) was proposed (as in Equation (8)) because it not only considered the difference in signal values (item led by β) but also evaluates the neighborhood shifting level (item led by α), the difference in signal slope (item led by γ), and the difference in signal concavity (item led by η). The weighting factors (α, β, γ, and η) were tunable and might change across individuals.

Fiducial Point Projection with DTW-Based Quasi-Synchronous Alignment
The DTW-base quasi-synchronous alignment introduces two modifications to the conventional quasi-synchronous alignment: (1) the intermediary reference signal pair, and (2)   Usually more than one path in the matrix grid can satisfy the requirements of the five constraints, but only one path minimizes the distance cost. A few different types of distance cost function variants have been developed for different application [33,34].
Some DTW applications concern only the Euclidean distance of the aligned points in the signal sequences (as in Equation (7)), whereas in the present study, the morphological similarity was most interested in and critical to fiducial point projection. A hybrid form of the cost function (termed the new cost function) was proposed (as in Equation (8)) because it not only considered the difference in signal values (item led by β) but also evaluates the neighborhood shifting level (item led by α), the difference in signal slope (item led by γ), and the difference in signal concavity (item led by η). The weighting factors (α, β, γ, and η) were tunable and might change across individuals.
New Cost Function(W)

Fiducial Point Projection with DTW-Based Quasi-Synchronous Alignment
The DTW-base quasi-synchronous alignment introduces two modifications to the conventional quasi-synchronous alignment: (1) the intermediary reference signal pair, and (2) Figure 7a is a color Doppler flow measurement at the aortic valve. In Figure 7a, the 966-ms period between R1 and R2 is selected as the synchronization target. The signals in Figure 7b,d represent the same nonreference ECG signal, whereas Figure 7b is rescaled (squeezed to fit signal length of 1003 ms to 966 ms) and shifted such that it can be visually aligned to the ECG R1-R2 section in Figure 7a. The signals in Figure 7c,f represent the same SCG signal (other than the reference SCG signal). Figure 7c has been rescaled and synchronized to Figure 7b.  Figure 7c,f represent the same SCG signal (other than the reference SCG signal). Figure 7c has been rescaled and synchronized to Figure 7b.

Common Procedures under Both Alignment Methods
An RR interval in the echocardiogram image was selected and the ends were annotated as R1 and R2. A visually recognized AC event was marked by a blue line and labeled as "AC" in the echocardiogram (Figure 7a). The present RR interval (966 ms) was obtained by pixel counting from the timing ticks in the echocardiogram.

Conventional Quasi-Synchronous Alignment
The SCG and ECG signals were shifted and rescaled to align R peaks to R1 and R2 in the ECG of echocardiogram (Figure 7a-c). The fiducial point was obtained by extending the blue line from Figure 7a-c.

DTW-Based Quasi-Synchronous Alignment
A reference signal pair of ECG and SCG was sorted out with the RR interval closest to the R1-R2 period. In this example, the reference signal pair had a heartbeat cycle of 966 ms. Shifting, but not rescaling, was required to align the reference signals until the ECG R peaks matched R1 and R2, as shown in Figure 7e,g. Referring to the condition in Figure 4, the ECG signals in Figure 7a,e, as well as the echocardiogram and SCG signal in Figure  7g, are postulated to align to each other (within the RR interval) spontaneously. The fiducial point AC was detected in the reference SCG signal by extending the blue line from

Common Procedures under Both Alignment Methods
An RR interval in the echocardiogram image was selected and the ends were annotated as R1 and R2. A visually recognized AC event was marked by a blue line and labeled as "AC" in the echocardiogram (Figure 7a). The present RR interval (966 ms) was obtained by pixel counting from the timing ticks in the echocardiogram.

Conventional Quasi-Synchronous Alignment
The SCG and ECG signals were shifted and rescaled to align R peaks to R1 and R2 in the ECG of echocardiogram (Figure 7a-c). The fiducial point was obtained by extending the blue line from Figure 7a-c.

DTW-Based Quasi-Synchronous Alignment
A reference signal pair of ECG and SCG was sorted out with the RR interval closest to the R1-R2 period. In this example, the reference signal pair had a heartbeat cycle of 966 ms. Shifting, but not rescaling, was required to align the reference signals until the ECG R peaks matched R1 and R2, as shown in Figure 7e,g. Referring to the condition in Figure 4, the ECG signals in Figure 7a,e, as well as the echocardiogram and SCG signal in Figure 7g, are postulated to align to each other (within the RR interval) spontaneously. The fiducial point AC was detected in the reference SCG signal by extending the blue line from As mentioned earlier, a fiducial point detection error resulted from the signal rescaling manipulation in the conventional quasi-synchronous alignment, as indicated by the width of the yellow rectangle in Figure 7h. Figure 7i displays the results of DTW point-to-point alignment with the new cost function between the reference SCG signal (red) and the target nonreference signal (blue).

Validation of DTW-Based Fiducial Point Detection Approach
An SCG fiducial point detection software tool was developed, using MATLAB R2020a, following the programming flowchart (in Figure 8) which depicts the SCG fiducial point detection procedures with DTW-based quasi-synchronous alignment. Two cardiac diagnostic parameters (PEP/LVET ratio and Tei index) were extracted from a dataset of 56 individuals to assess the clinical application of the proposed SCG fiducial point detection method and to validate the effectiveness of the software. In addition, Figure 8 also reveals that the correlation of averaged diagnostic parameters versus LVEF and ROC classification analysis were conducted at the end of the proof-of-concept experiment.
R2020a, following the programming flowchart (in Figure 8) which depicts the SCG fiducial point detection procedures with DTW-based quasi-synchronous alignment. Two cardiac diagnostic parameters (PEP/LVET ratio and Tei index) were extracted from a dataset of 56 individuals to assess the clinical application of the proposed SCG fiducial point detection method and to validate the effectiveness of the software. In addition, Figure 8 also reveals that the correlation of averaged diagnostic parameters versus LVEF and ROC classification analysis were conducted at the end of the proof-of-concept experiment.

Clinical Data Acquisition and Preprocessing
At least two echocardiogram images were required to detect all the interested cardiac events (MO, MC, AO, and AC) because an ultrasonic probe can only examine one cardiac valve at a time. A set of simultaneously measured ECG and SCG signal pairs were clipped from the continuous SCG measurement. As shown in Figure 7b,c, the ECG and SCG signal clips were sectioned according to ECG T waves, from T0 to T2, to include a complete heartbeat section of the centered RR interval and with extra intervals before and after. Prior to the fiducial point detection, signal clips went through the data preprocessing including signal detrending, band-pass filtering, and wavelet denoising.

Echocardiogram-Reference Signal Alignment
An RR interval in the echocardiogram was selected for the interested cardiac event identification as shown in the section confined by R1 and R2 lines in Figure 7a. To minimize the fiducial point detection error, an ECG/SCG signal pair with RR interval period the same as or close to the duration between R1 and R2 lines were screened out from the signal clips as the reference signal pair. The reference signal pair were aligned to the R1-R2 section in the echocardiogram only through shifting, as presented in Figure 5 or in Figure 7e,g.

Identification and Mapping of Cardiac Events in Echocardiogram to Reference Signals
After the alignment of echocardiogram images and reference signals, the valve opening and closure events were identified and annotated in the images, as indicated by the blue line in Figure 5a or Figure 7a. By extending the lines to reference SCG signals, the intersections were annotated as the detected SCG fiducial points in the reference signal.

Projection of Fiducial Points from Reference to Nonreference Signals
The reference SCG signals with fiducial point annotations were used to project the fiducial points to nonreference signals through DTW alignment, under the proposed new cost function optimization. Figure 6 illustrates the results of the point-to-point mapping of the alignment and the aligned path with minimized cost function in the cost matrix.

PEP/LVET Ratio and Tei Index Calculation
To validate the clinical practicability and effectiveness of the DTW-based fiducial point detection approach, the cardiac parameters (PEP/LVET ratio and Tei index) for each nonreference SCG signal clip were calculated according to Equations (5) and (6) from the projected fiducial points.

Index Statistics Calculation
To assess the cardiac health of an individual, the averaged PEP/LVET ratio and Tei index were utilized instead of using the indexes from a single signal clip.

Correlation of the Averaged Indexes to the LVEF
The collection of the averaged indexes (PEP/LVET ratio and Tei index) for 56 individuals were correlated to the individual's clinical LVEF assessment (in Figure 9). The coefficient of determination (R 2 ) was employed as the indicator of the correlation between the averaged indexes and the clinical LVEF assessment. Each graph is annotated with mean (red squares) and standard deviation (blue error bars) of the variable from subjects, the 95% confidence interval of the regression line (shaded area), the coefficient of determination (R2) and the optimal operating point determined in the ROC curve analysis (yellow point).

ROC Curve Analysis
Four predictive models in ROC curve analysis ( Figure 10) were used to distinguish the patients of heart failure with reduced ejection fraction (HFrEF), using the predictors of (1) clinical LVEF assessment, (2) PEP/LVEF ratio, (3) Tei index, and (4) the mean PEP/LVEF ratio and Tei index, respectively. The values of area under the ROC curve (AUC) were determined, to evaluate the predictability of the models as well as the effectiveness of these diagnostic parameters derived from the DTW-base quasi-synchronous alignment. Each graph is annotated with mean (red squares) and standard deviation (blue error bars) of the variable from subjects, the 95% confidence interval of the regression line (shaded area), the coefficient of determination (R2) and the optimal operating point determined in the ROC curve analysis (yellow point).

ROC Curve Analysis
Four predictive models in ROC curve analysis ( Figure 10) were used to distinguish the patients of heart failure with reduced ejection fraction (HFrEF), using the predictors of (1) clinical LVEF assessment, (2) PEP/LVEF ratio, (3) Tei index, and (4) the mean PEP/LVEF ratio and Tei index, respectively. The values of area under the ROC curve (AUC) were determined, to evaluate the predictability of the models as well as the effectiveness of these diagnostic parameters derived from the DTW-base quasi-synchronous alignment.

Results
With IRB approval, the SCG-echocardiogram data of the 56 individuals were employed for the proof-of-concept experiments and the effectiveness evaluation of DTWbased fiducial point detection approach. The experimental data were reused from the previous research conducted by Lin et al. on a multichannel SCG system [9]. Table 1 lists the subjects' demographic information and SCG-derived cardiac parameters, including patient ID, sex, age, clinical LVEF assessment, hospital diagnosed cardiovascular diseases, the number of examined SCG clips and the statistics of PEP/LVET ration and Tei index derived by the DTW-based SCG fiducial point detection method. The means ± standard deviations of age and LVEF are 52.1 ± 22.3 years and 50.8% ± 16.3%, respectively. The mean and standard deviation of PEP/LVET ratio and Tei index were calculated from the number of examined SCG clips. The number of data clips used for fiducial point detection ranged from 34 to 106, with a mean ± standard deviation of 69.2 ± 16.2.

Results
With IRB approval, the SCG-echocardiogram data of the 56 individuals were employed for the proof-of-concept experiments and the effectiveness evaluation of DTW-based fiducial point detection approach. The experimental data were reused from the previous research conducted by Lin et al. on a multichannel SCG system [9]. Table 1 lists the subjects' demographic information and SCG-derived cardiac parameters, including patient ID, sex, age, clinical LVEF assessment, hospital diagnosed cardiovascular diseases, the number of examined SCG clips and the statistics of PEP/LVET ration and Tei index derived by the DTW-based SCG fiducial point detection method. The means ± standard deviations of age and LVEF are 52.1 ± 22.3 years and 50.8% ± 16.3%, respectively. The mean and standard deviation of PEP/LVET ratio and Tei index were calculated from the number of examined SCG clips. The number of data clips used for fiducial point detection ranged from 34 to 106, with a mean ± standard deviation of 69.2 ± 16.2. The applicability of SCG fiducial point detection using DTW-based alignment was validated through two experiments: (1) the linear correlation between SCG-derived indexes (PEP/LVET ratio and Tei index) and clinical LVEF assessment and (2) the analysis of ROC classification to distinguish patients with HFrEF or else.

Linear Correlation Models
The clinical LVEF assessment has been reported to be negatively proportional to the PEP/LVET ratio and Tei index for the patients with cardiac symptoms of varying severity [3,5,7,35,36]. To validate the effectiveness of the SCG fiducial points and the associated CTIs derived using the DTW-based quasi-synchronous alignment method, three general linear models (GLMs) were generated for the correlation analysis to prove the negative proportionality. The trendlines of the 56-subject clinical LVEF assessments were synthesized under three general linear regression models by using the univariate predictors of: (1) the PEP/LVET ratio, (2) Tei index, and (3) the mean PEP/LVET ratio and Tei index (shown in Figure 9). The three general linear regression models are formulated as Equations (9), (10), and (11). Favorable coefficients of determination (R 2 ) for the three univariate linear models were obtained in this 56-subject experiment, with R 2 = 0.768, 0.86, and 0.894 for (1), (2) and (3), respectively. The negative proportionalities in the graphs of Figure 9 are obvious, whereas the standard deviation (indicated by the blue error bars) and 95% confidence intervals (indicated by the shaded area) are larger for patients assessed as having lower LVEF than normal people (with higher LVEF).

ROC Classification
The LVEF assessment has clinical utility for cardiovascular syndrome classification and heart failure diagnosis [37]. According to the 2016 European Society of Cardiology (ESC) guidelines regarding the diagnosis and treatment of acute and chronic heart failure, the class of HFmrEF (heart failure with mid-range ejection fraction) was defined as an LVEF assessment larger than 40% but less than 50%. The other classes of HFrEF and HFpEF (heart failure with preserved ejection fraction) were retained [38].
The second proof-of-concept experiment for the DTW-based fiducial point detection approach was the application of the univariate ROC models to classify the subjects with HFrEF label listed in the disease column of Table 1. In Figure 10, four variables, including (1) LVEF, (2) PEP/LVET ratio, (3) Tei index, and (4) the mean PEP/LVET ratio and Tei index, were employed as the univariate predictors. To build the models, four data pairs, comprising diagnosis disease labels and the values of the predictors, were modeled by the GLMs as with the logit link function and binomial distribution function. The GLM-fitted probability vectors were set as scores and the "HFrEF" tag was set to as the positive label in the ROC curve configurations. Figure 10 exhibits the ROC classification result of four models to predict the diagnosis of HFrEF; extra indicators including the TP and FP rates, AUCs, and the optimal operating points of the predictors are also annotated. The optimal operating point was estimated at the condition that the classifier gave the best trade-off between the costs of failing to detect positives against the costs of raising false alarms.
The AUC of the LVEF model outperformed the other three models, with an AUC of 0.995 and the optimal operating point (LVEF cutoff at 0.4) at TP = 1 and FP = 0.029 (Figure 10a). This result conformed to the lower bound of HFmrEF of 40% suggested in the 2016 ESC guidelines. The AUC of the PEP/LVET ratio model was slightly greater than that of the Tei index model (with AUC = 0.937 > 0.928). In other words, the cardiologists had a 93.7% probability of correctly distinguish a patient with HFrEF from others with the aid of the PEP/LVET ratio model. Using the Tei index as the predictor, HFrEF could be expected to correctly diagnose 92.8% of the cases. As shown in Figure 10b,c, both models has the same TP and FP for the optimal operating points. Using the mean PEP/LVET ratio and Tei index as predictors improved the diagnostic prediction of any original predictors, with AUC = 0.949 (Figure 10d). In general classification evaluations, ROC model predictions with AUC values equal to 0.5 suggest no discriminative ability. AUC values between 0.7 and 0.8, between 0.8 and 0.9, and >0.9 indicate acceptable, excellent, and outstanding discriminative ability, respectively [39].
Through the proof-of-concept experiments of GLM models and ROC curve predictions, the CTIs and the cardiac indexes (PEP/LVET ration and Tei index) derived from the DTWbased quasi-synchronous alignment herein were confirmed to be reasonable in clinical practice. The optimal operating points corresponding to the last three ROC curves are also annotated in Figure 9. Moreover, the corresponding optimal decision points (0.4, 0.465, 0.436 and 0.45) for HFrEF assessment in the ROC curves were in Figure 10 for the comparison of the suggestion in 2016 ESC guidelines, LVEF = 0.4. Hopefully, these findings will provide reference for future study.

Discussion and Conclusions
The present study examined the issue of misalignment in the conventional quasisynchronous alignment method and introduced the intermediary signals (reference signal pair of ECG and SCG) and DTW algorithm to eliminate the timing error in SCG fiducial point detection. The advantages and effects of the collaboration of reference signals and DTW algorithm as well as the new distance cost function were demonstrated in the graphical illustrations. The combination of the intermediary signals and DTW alignment in SCG fiducial point detection was proposed and realized for the first time.
It was known that SCG fiducial point delineation was hindered by artifact effects, the ambiguity in specific event waveforms and the lack of detection procedures. The proposed method abandoned the idea to look for the fiducial point co-occurring waveforms but seek for fusing heterogeneous modalities to allocate the fiducial points in the personal SCG reference signal. DTW algorithm was leveraged afterwards to project the fiducial points to non-reference signals. A merit of aligning signal pair with DTW algorithm is that it does not just align the prominent peaks or valleys but the entire signals. Because the extreme points serve as the anchor points during the alignment, points in between are enforced to be regulated. On the condition that the artifact does not override the signal waveform too much, DTW could overcome the distortion. Therefore, in case of minor signal distortion or featureless points are identified as the fiducial points, the projection can still function correctly with the assist of DTW.
This proposed DTW-based quasi-synchronous alignment is not only dedicated to SCG fiducial point detection but is also applicable to other scenarios. The non-ECG reference signal (SCG reference signal) and the application target (seismocardiography) could be changed to other cardiac signals, such as phonocardiography, ballistocardiography and impedance cardiography. The echocardiogram images could also be changed to other imaging modalities or other cardiac signal templates with the target cardiac events annotated. The application concept of the proposal is not limited in biomedical scenarios; it is possible to extend to the speech recognition or gesture identification and so on.
As the concept was proven clinically in the 56-individual dataset, the software program implemented based on the proposed flowchart achieved high prediction rates (>92.8%) in the experiment of distinguishing patients with HFrEF from others. With the verified diagnostic utility, the proposed quasi-synchronous fiducial point detection procedures could be further refined and standardized to expedite the development in SCG technology and shorten the path from bench to bedside.
Recently, machine learning has been one of the major topics in biomedical engineering; however, building a machine learning model for SCG fiducial point detection requires plenty of labeled training data. The proposed flowchart could be used as a framework and guidelines of the automatic program development for fiducial point detection. Therefore, the program-generated SCG fiducial point annotations could be used as the labeled training data set for the supervised machine learning process in alternative fiducial point detection approaches or other feature identification applications. In addition, by adding new routines, the framework can extend more features to the SCG research, such as signal template generation, signal morphology clustering and multichannel SCG applications. In the future, the framework may be further integrated into the cloud computing services together with the ambulatory ECG/SCG system for home-based real time health monitoring.