A method and device for heart sound segmentation based on hidden markov heart cycle

By employing a hidden Markov cardiac cycle-based heart sound segmentation method, combined with Hilbert envelope extraction and an improved Viterbi algorithm, the accuracy problem of heart sound signal segmentation under conditions without biochemical indicators was solved, achieving efficient segmentation of heart sound signals and accurate diagnosis of cardiovascular diseases.

CN115828168BActive Publication Date: 2026-06-30HANGZHOU DIANZI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU DIANZI UNIV
Filing Date
2022-12-09
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Without the support of biochemical indicators, current technologies are not effective in segmenting heart sound signals, making it difficult to accurately locate the first and second heart sounds, which affects the accuracy of cardiovascular disease diagnosis.

Method used

A heart sound segmentation method based on the Hidden Markov Cycle (HMC) is adopted, which combines Hilbert envelope extraction, maximum and minimum value presets for different leads, and an improved diastolic extraction model of the HMC. Through baseline calibration, wavelet denoising, and normalization, the optimal time span of the heart sound signal is located using an improved Viterbi algorithm.

Benefits of technology

It improves the accuracy of heart sound signal segmentation, reduces the probability of noise-induced misjudgment, and achieves efficient heart sound segmentation under conditions without biochemical indicators, supporting the accurate diagnosis of cardiovascular diseases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115828168B_ABST
    Figure CN115828168B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for heart sound segmentation based on a Hidden Markov Model (HMM) cardiac cycle. The method involves: extracting the signal envelope from the heart sound signal using Hilbert's algorithm; obtaining the peak positions of the first heart sound (S1) and the second heart sound (S2) after Hilbert envelope extraction based on preset baselines for different leads; locating the peaks based on the cardiac cycle; extracting the diastolic phase based on an improved HMM; locating the optimal time span of heart sound signals S1 and S2 using an improved Viterbi algorithm; and segmenting the original heart sound signal using the time span and the peak positions of S1 and S2. This invention employs an improved HMM and an improved Viterbi forward algorithm to calculate the duration of heart sound intervals S1 and S2, combined with the cardiac cycle, to accurately locate the peak positions of heart sound intervals, thus improving the performance of heart sound segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of medical signal processing, specifically to a heart sound segmentation method and apparatus based on the Hidden Markov Cycle, which integrates a Hilbert envelope extraction-based method, maximum / minimum presets for different leads, and a diastolic extraction model based on the Hidden Markov Cycle. Background Technology

[0002] Cardiovascular disease refers to all diseases related to the heart and blood vessels, among which coronary heart disease is one of the most serious threats to human life and health. The number of people suffering from cardiovascular disease is large, and the prevalence is continuously rising. Therefore, the prevention and treatment of cardiovascular disease has become an urgent public health issue.

[0003] Diagnosis of cardiovascular diseases is a crucial component of their prevention and treatment. Currently, clinical diagnosis of cardiovascular diseases generally includes techniques such as electrocardiography (ECG), echocardiography, coronary CT angiography, and coronary angiography. However, these techniques still require continuous improvement. For example, coronary angiography is considered the "gold standard" for diagnosing coronary heart disease, but its invasive nature, high cost, and limited access to medical resources mean it is not suitable for all patients.

[0004] The development of phonocardiography (PCG)-based diagnostic technologies has offered possibilities for solving the aforementioned problems. In terms of diagnostic capability, PCG testing can promptly detect cardiac abnormalities, providing effective information and auxiliary analysis for cardiovascular function diagnosis, treatment plan determination, and complication tracing. In terms of diagnostic efficiency, PCG-based automated diagnosis of cardiovascular diseases has advantages such as simplicity, economy, non-invasiveness, and effectiveness.

[0005] Fundamental heart sounds (FHSs) refer to the first heart sound (S1) and the second heart sound (S2). Segmenting FHSs is the primary issue in the automatic diagnosis of PCG, and accurate localization of FHSs is a prerequisite for determining the systolic and diastolic intervals of PCG.

[0006] In recent years, some research results have been achieved in the field of heart sound segmentation from different research perspectives. These segmentation algorithms can be roughly divided into four categories: envelope-based methods, frequency domain-based methods, artificial intelligence-based methods, and assisted segmentation methods. However, most methods usually require a large number of heart sound data samples for learning and have high computational requirements. They also have the risk of overfitting or need to use electrocardiogram signals or photoplethysmography signals to assist in the segmentation task. These methods require high-quality data support to achieve high accuracy. This has resulted in poor segmentation performance for pure PCG signals without simultaneous input of many biochemical indicators.

[0007] Therefore, there is an urgent need to provide a segmentation method that strives to construct a more accurate PCG signal without relying on any biochemical indicators, so as to achieve accurate localization of heart sounds. Summary of the Invention

[0008] The purpose of this invention is to address the aforementioned difficulties in PCG signal segmentation in clinical practice, and to provide a heart sound segmentation method and apparatus based on the Hidden Markov Cycle (HMC), specifically involving a heart sound segmentation algorithm based on the HMC, which integrates a Hilbert envelope extraction, maximum / minimum presets for different leads, and a diastolic extraction model based on an improved HMC.

[0009] In a first aspect, the present invention provides a heart sound segmentation method based on the Hidden Markov Cycle, the method comprising the following steps:

[0010] Step 1: Acquire heart sound signals and preprocess them to obtain clean heart sound signals;

[0011] Step 2: Hilbert extracts the signal envelope;

[0012] Perform a Hilbert transform on the preprocessed heart sound signal x(t) from step one to obtain... Its definition is:

[0013]

[0014] Where x(τ) is the heart sound signal, t represents a fixed time value, and τ represents time;

[0015] Therefore, the Hilbert transform is essentially an idealized 90-degree phase shifter; taking the heart sound signal x(t) as its real part, its Hilbert transform is... The complex signal z(t) formed by the imaginary part is the analytic signal of x(t), and its expression is:

[0016]

[0017] Taking the modulus of z(t) yields the envelope of the heart sound signal x(t);

[0018] Step 3: Based on the preset baseline of extreme values ​​in different leads, obtain the locations of the first heart sound peak (S1 peak) and the second heart sound peak (S2 peak) after Hilbert envelope extraction; specifically:

[0019] 3-1 The peak position of heart sounds varies greatly at different auscultation sites, so the maximum and minimum values ​​of a certain heart sound in the audio range after Hilbert envelope extraction are statistically analyzed.

[0020] 3-2 Determine the range of the baseline value based on different extreme values. For example, for heart sounds acquired at the auscultation position (AV), the range of the envelope extreme value is [0.06-a, 0.06+a], where 'a' represents the fluctuation value due to individual differences. Therefore, the calibration line is set to [0.008-a, 0.008+a]. For heart sounds acquired at the auscultation positions (MV and TV), the range of the envelope extreme value is [0.015-a, 0.015+a]. Therefore, the calibration line is set to [0.05-a, 0.05+a]. For heart sounds acquired at the auscultation position (PV), the range of the envelope extreme value is [0.3-a, 0.3+a]. Therefore, the calibration line is set to [0.1-a, 0.1+a].

[0021] 3-3 Extract the peak values ​​above the baseline as the first heart sound peak (S1 peak) and the second heart sound peak (S2 peak);

[0022] Step 4: Peak location based on cardiac cycle;

[0023] Based on the characteristics of heart sound signals, the diastolic phase is longer than the systolic phase in a normal cardiac state. Since the periodic changes in heart sounds cause S1, systolic, S2, and diastolic phases to appear sequentially and periodically, the signal peaks S1 and S2 also appear adjacent to each other. Therefore, the peak correspondence between S1 and S2 can be determined, and the distance between each peak can be calculated.

[0024] Let a certain peak value be q n , n represents the heart sound peak number, and the peak value to its left is q n-1 Distance q n Duration t n-1 Its right-hand peak q n+1 Distance q n Duration t n Comparison t n-1 With t n Size, if t n-1 >t n Then identify the peak value q n Let S1 be S1; if t n-1 <t n Then identify the peak value q n Let S2 be the peak value. Then, the positions of S1 and S2 can be determined based on the relationship between the peak values.

[0025] Step 5: Diastolic extraction based on an improved hidden Markov cardiac cycle;

[0026] Using the heart sounds extracted from the Hilbert envelope as the observation sequence, and the four states of the heart sounds as the hidden states, denoted as set C = (C1, C2, C3, C4), where C1 represents S1, C2 represents systole, C3 represents S2, and C4 represents diastole, the parameter λ is a property of the Hidden Markov Model, used to indicate that the next state of the heart sound signal after Hilbert envelope extraction depends only on the state occupied in the current time. The overall representation is as follows:

[0027] λ=(A,B,π) (3)

[0028] Where A represents the state transition probability matrix, which determines the state sequence, then

[0029]

[0030] Where a ij Indicates from state C i To state C j The probability of transition, c t This represents the state of the model at time t;

[0031] At this point, based on the quasi-periodic biological signal generated by the regular vibration of heart sounds, which always cycles through four states—S1, systole, S2, and diastole—the state transition probability matrix A is expressed as:

[0032]

[0033] B represents the observation state probability matrix, which determines the observation sequence. Let the set of observation sequence be O = {O1, O2, ..., O...} t}, B={b j (O t )}, where b j (O t ) is the observation symbol O at state j. t The probability of the output;

[0034] π represents the set of initial state probabilities, then

[0035] π={π i},π i =P[c i =C i ],(1≤i≤4) (6)

[0036] Since the actual PCG signals are collected at any state during the cardiac cycle, but the duration of each interval of the PCG signal is not uniform, the initial state probability distributions π1, π2, π3, and π4 for the four states of S1, systole, S2, and diastole are as follows, based on the characteristics of the PCG signal:

[0037]

[0038] At this point, we can obtain

[0039] λ HMCC =(A,B,π) HMCC (8)

[0040] Where λ HMCC π represents the properties of the improved Hidden Markov Model cardiac cycle. HMCC ={π1, π2, π3, π4};

[0041] Step 6: Use the improved Viterbi algorithm to locate the optimal time span of heart sound signals S1 and S2;

[0042] 6-1 Initialize the flag k = 0;

[0043] 6-2 The heart sound at a certain sampling point after Hilbert envelope extraction is calculated according to formula (10). according to Determine if the value with the highest probability is C. j If j = 1 or 3, update the current label k = k + 1; otherwise, label k = 0. Then proceed to step 6-3, and repeat step 6-2 for the next sampling point. Where C1 corresponds to S1 and C3 corresponds to S2.

[0044] 6-3 Set a minimum state duration threshold g. If the number of consecutive non-zero markers k is greater than or equal to the threshold g, then the heart sound segment corresponding to the current consecutive non-zero marker k is considered to be s. i Find the interval where i = 1 or 2, and obtain the duration L of the current interval; if the number of consecutive non-zero markers k is less than the threshold g, discard the value and consider it as the duration of an incomplete interval;

[0045] 6-4 Calculate the current s based on the duration L obtained above. i The probability of the interval containing i = 1 or 2

[0046]

[0047]

[0048]

[0049] in s i The forward probability of the m-th sampling point in the interval where i = 1 or 2; This represents the mean;

[0050] Since the locations of the peaks S1 and S2 are known, but the correspondence between the durations of S1 and S2 and the peaks is unclear (i.e., the time span of the peaks), the time spans of S1 and S2 can be approximated by expectation.

[0051]

[0052] Step 7: Use the time span obtained in Step 6 The peak locations of S1 and S2, determined in step four, are used to segment the original heart sound signal.

[0053] Preferably, the preprocessing in step one includes baseline calibration, wavelet denoising, and normalization.

[0054] More preferably, the preprocessing specifically includes:

[0055] First, baseline calibration is performed to correct the position of drifting heart sound signals.

[0056] Secondly, discrete wavelet transform is used for wavelet decomposition and reconstruction, which significantly reduces the noise component in the processed wavelet detail coefficients.

[0057] Finally, normalization was performed to obtain the standardized PCG signal.

[0058] In a second aspect, the present invention provides a heart sound segmentation system, comprising:

[0059] The data acquisition and preprocessing module is used to acquire heart sound signals, preprocess them, and obtain clean heart sound signals.

[0060] The Hilbert envelope processing module extracts the Hilbert envelope from the heart sound signals output by the data acquisition and preprocessing module.

[0061] The peak extraction module extracts the locations of the first heart sound peak (S1 peak) and the second heart sound peak (S2 peak) after extracting the Hilbert envelope.

[0062] The peak localization module performs peak localization of heart sounds based on the cardiac cycle after extracting the Hilbert envelope;

[0063] The optimal time span calculation module uses the improved Viterbi algorithm to locate the optimal time span between the first heart sound (S1) and the second heart sound (S2) in the heart sound signal;

[0064] The segmentation module uses the time span output by the optimal time span calculation module and the peak positioning positions of S1 and S2 output by the peak positioning module to segment the heart sound signal output by the data acquisition and preprocessing module.

[0065] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed in a computer, it causes the computer to perform the method described thereon.

[0066] Fourthly, the present invention provides a computing device, including a memory and a processor, characterized in that the memory stores executable code, and when the processor executes the executable code, it implements the method described above.

[0067] The beneficial effects of this invention are:

[0068] This invention performs baseline calibration on signals with offsets; uses wavelet denoising algorithm to filter noisy signals; and normalizes heart sound signals to highlight the features of the first and second heart sounds, eliminating the statistical average of common dimensions, effectively avoiding the complexity of heart sound interval identification and segmentation techniques for specific data.

[0069] This invention provides a Hilbert envelope extraction algorithm to obtain the envelope features of heart sound signals.

[0070] This invention provides a method for setting a baseline based on the maximum and minimum preset values ​​of different leads, for different auscultation positions, for determining the peak points above the baseline.

[0071] This invention provides a hidden Markov model-based cardiac cycle algorithm. Based on the physiological characteristics of heart sounds, the diastolic duration is longer than the systolic duration, which is used to classify and locate the peak points S1 and S2. Combining the periodicity of the hidden Markov model and the property that future states depend only on the current state, an improved Viterbi algorithm is used to estimate the durations of S1 and S2 to obtain more accurate heart sound intervals. A threshold value is set based on the shortest duration of the diastolic and systolic phases of the heart sounds, allowing noise that is too close to the peak to be filtered out, reducing the probability of peak misjudgment.

[0072] In summary, this invention effectively considers the differences in auscultation locations before setting the peak values ​​of S1 and S2, and classifies the intervals by combining the physiological characteristics of heart sounds. This not only fully reflects the unique characteristics of heart sounds, but also reduces the probability of misjudging peak values ​​due to noise errors. An improved Hidden Markov Model combined with an improved Viterbi forward algorithm is used to calculate the duration of heart sound intervals S1 and S2, and the peak values ​​of heart sounds S1 and S2 are located by combining the cardiac cycle, accurately calibrating the precise location of heart sound intervals and improving the performance of heart sound segmentation. Attached Figure Description

[0073] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0074] Figure 1 The system flowchart of the heart sound segmentation method based on the hidden Markov cardiac cycle provided in the embodiments of the present invention is shown.

[0075] Figure 2 A flowchart of the improved Viterbi algorithm for locating time spans provided in an embodiment of the present invention. Detailed Implementation

[0076] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0077] The efficient and accurate authentication based on PCG signal segmentation technology has great theoretical research and practical application value, and can provide new solutions to improve the accuracy of biometric-based medical diagnosis both domestically and internationally. Figure 1 The following is a system flowchart of the PCG signal segmentation method provided in an embodiment of the present invention, and the present invention will be further described below:

[0078] Step 1: Obtain a clean heart sound signal using a normalized denoising algorithm based on baseline calibration and wavelet denoising. First, baseline calibration is performed to correct the position of the drifting heart sound signal; second, discrete wavelet transform is used for wavelet decomposition and reconstruction, which significantly reduces the noise component in the processed wavelet detail coefficients; finally, normalization is performed to obtain the denoised normalized PCG signal.

[0079] Step 2: Hilbert Transform Extraction of Signal Envelope. For a real signal x(t), its Hilbert transform is denoted as H[x(t)] or Its definition is:

[0080]

[0081] Therefore, the Hilbert transform is essentially an idealized 90-degree phase shifter. Taking the real signal x(t) as its real part, its Hilbert transform before and after... The complex signal z(t) formed by the imaginary part is the analytic signal of x(t), and its expression is: Taking the modulus of z(t) yields the envelope of the real signal x(t).

[0082] Step 3: Based on the maximum and minimum preset values ​​for different leads. Determine the location of the peak values ​​in S1 and S2, that is, determine the peak value of the Hilbert envelope of the heart sounds.

[0083] ① Set a baseline and extract the peak value above the baseline position as the position of S1 and S2.

[0084] ②The peak position of heart sounds varies greatly at different auscultation sites, so it is necessary to pre-calculate the maximum and minimum values ​​of a certain heart sound within the audio range;

[0085] ③ Determine the range of the baseline value based on different extreme values. For example, for heart sounds collected at the auscultation position AV, the maximum and minimum envelope value fluctuates around 0.06, so the calibration line is set to around 0.008; at the auscultation positions MV and TV, the maximum and minimum envelope value fluctuates around 0.015, so the calibration line is set to around 0.05; at the auscultation position PV, the maximum and minimum envelope value fluctuates around 0.3, so the calibration line is set to around 0.1.

[0086] Step 4: Peak Location Based on Cardiac Cycle. According to the characteristics of heart sound signals, the ratio of systolic to diastolic duration is approximately 3:5. Under normal circumstances, the ratio of S1S2 to S2S1 is approximately 1:2, with only a few pathological cases showing almost equal ratios. In a normal cardiac state, the diastolic phase (duration from the start of S2 to the start of the next S1) is longer than the systolic phase (duration from the start of S1 to the start of the next S2). Since the periodic changes in heart sounds cause S1, systolic, S2, and diastolic phases to occur sequentially and periodically, the signal peaks S1 and S2 also occur adjacently. Therefore, the correspondence between S1 and S2 and the peak values ​​can be determined, and the distance between each peak can be calculated. Let a certain peak value be q. n , n represents the heart sound peak index n∈N, and its left-hand peak q n-1 Distance q n For duration t n-1 Its right-hand peak q n+1 Distance q n Duration t n Comparison t n-1 With t n Size, if t n-1 >t n Then identify the peak value q n Let S1 be S1; if t n-1 <t n Then identify the peak value q nLet S2 be the peak value. The positions of S1 and S2 can then be determined based on the relationship between their peak values. In clinical practice, cardiologists use the following standard definitions to indicate the beginning and end of the S1 and S2 sounds: S1 begins with the onset of a high-frequency vibration caused by mitral valve closure, S2 begins with the onset of a high-frequency vibration caused by aortic closure, and the ends of S1 and S2 are indicated by the end of the high-frequency vibration.

[0087] Since peak formation is not a linear process but involves a time span, this time span significantly impacts segmentation errors. This invention aims to reduce the impact of this time span on segmentation accuracy using a heart sound segmentation algorithm based on Hidden Markov Models (HMMs). In other words, it seeks to approximate or approximate this distance as closely as possible without knowing the exact time span.

[0088] Step 5: Diastolic Extraction Based on Hidden Markov Model (HMM) Cardiac Cycle. A Hidden Markov Model (HMM) is a statistical analysis model suitable for describing continuous data. It is a type of Markov chain that operates by inferring the probability of being in certain discrete "hidden states" and moving between these states to observe the results of each state. This invention proposes a heart sound segmentation algorithm based on the HMM cardiac cycle to solve for the aforementioned time span.

[0089] The purpose of introducing a Hidden Markov Model (HMM) in this invention is to leverage its periodicity and the fact that future states depend only on the current state. For the PCG signal studied in this invention, it is considered an observation sequence, with the four states of heart sounds as hidden states, denoted as set C = (C1, C2, C3, C4), where C1 represents S1, C2 represents systole, C3 represents S2, and C4 represents diastole. The parameter λ is a property of the HMM, representing that the next state of the PCG signal depends only on the state occupied in the current time. The overall representation is as follows:

[0090] λ=(A,B,π) (2)

[0091] Where A represents the state transition probability matrix, which determines the state sequence, then

[0092]

[0093] a ij Indicates from state C i To state C jThe probability of state transition. At this point, the quasi-periodic biological signal generated by the regular vibrations of heart sounds always cycles through four states: S1, systole, S2, and diastole. For example, S2 must begin after the end of systole, and its end is followed by the beginning of diastole. S1 can only begin after the end of the diastolic phase of the previous heart sound, and its end is immediately followed by the beginning of systole. Therefore, the state transition probability matrix A is represented as:

[0094]

[0095] B represents the observation state probability matrix, which determines the observation sequence. Let the set of observation sequence be O = {O1, O2, ..., O...} t}, B={b j (O t )}, where b j (O t ) is the observation symbol O at state j. t The output probability. π represents the initial state probability set, then...

[0096] π={π i},π i =P[c i =C i ],(1≤i≤4) (5)

[0097] Since the actual PCG signals were acquired at any point during the cardiac cycle, and because the duration of each interval of the PCG signal is not uniform, based on the characteristics of the PCG signal, literature review, and signal observation, the duration of S1 is approximately 70-150 ms, the duration of S2 is 60-120 ms, and the average durations of diastole and systole are approximately 0.4 s and 0.2 s, respectively. Furthermore, the period centered on the position of the maximum S2 peak, as analyzed in section 2.3.1, equals the average S2 duration and is labeled as the S2 sound. The period between S1 and S2 is labeled as the systolic period, and the period between S2 and S1 is labeled as the diastolic period. The average duration of S1 is set to 122 ms, the average duration of S2 is set to 92 ms, and the special window is set to the average S2 duration plus the standard deviation of S2, i.e., 114 ms. Extract the audio range between the peaks of S2 and S1, and subtract the maximum duration of the peaks of S2 and S1 within the diastolic range (the maximum duration of S1 is 150ms, and the peak position is generally the median of the duration; the duration of S2 is 120ms, and the peak position is the starting position of S2). S2 is 120ms and S1 is 75ms, which constitutes the diastolic period. This allows for a relatively accurate approximate distribution of the initial state probability.

[0098]

[0099] At this point, we can obtain

[0100] λ HMCC =(A,B,π) HMCC (7)

[0101] Step 5: Improved Viterbi algorithm for locating time spans. The purpose of this invention for heart sound segmentation is to find the time spans of the S1 and S2 peaks corresponding to all known observation sequences, within the model parameters λ described above. HMCC Under the premise that, the Viterbi algorithm can be used to find the optimal time span of heart sound signals S1 and S2.

[0102] Viterbi algorithm is a forward algorithm used to calculate the forward probability δ. t (j). Represents time t when c t The instantaneous probability of being in state j.

[0103] δ t (j)≈P(O1,O2,…,O t ,c i =C j ,c t+1 ≠C j |λ) (8)

[0104] The specific process is as follows: Figure 2 As shown:

[0105] The diagram uses S1 as an example for positioning; S2 is simply C3 replaced by C1 in the diagram. This algorithm is applied to PCG signals and consists of three steps: ① Locating the starting point of S1 / S2; ② Determining the signal continuity and locating the ending point; ③ Calculating the duration of S1 / S2.

[0106] ① Find the point with the highest initial probability corresponding to S1 and S2. S1 corresponds to C1 and S2 corresponds to C3. That is, find the point with the highest probability of C1 / C3, and set the marker k = 0.

[0107] ② Determine if k+1 satisfies condition ①. If it does, then k = k+1; otherwise, k = 0. Repeat this process. If a point satisfies the condition but the next point does not, then k is set to 0. Set a minimum state duration threshold g. If k is less than the threshold g, continue judging. If k is greater than or equal to the threshold and the next state still satisfies condition ①, continue the loop. If k is greater than or equal to g and does not satisfy condition ①, then exit the loop.

[0108] ③ At this point, the number of points recorded by k is the duration L of S1 or S2.

[0109]

[0110]

[0111] Since the locations of the peaks S1 and S2 are known, but the correspondence between the durations of S1 and S2 and the peaks is unclear (i.e., the time span of the peaks), we can approximate the time spans of S1 and S2 by taking an expectation.

[0112]

[0113]

[0114] The actual recorded heart sounds may contain noise with high peak values, which may lead to the noise peak being mistakenly identified as S1 or S2. Therefore, it is necessary to add a judgment condition. Based on the average duration of the systolic phase of 0.2s, the shortest duration of the diastolic phase is set as the threshold value to filter out points that are too close to the peak value.

[0115] The heart sound segmentation algorithm based on the Hidden Markov Cycle proposed in this invention extracts the envelope of the heart sound signal through the Hilbert envelope, sets the baseline position of the heart sound at different auscultation locations, locates the S1 and S2 peak point intervals according to the division properties of the cardiac cycle, and calculates the time span of the region corresponding to the peak by combining the Hidden Markov Extended Model, so as to accurately segment the diastolic interval.

Claims

1. A method for heart sound segmentation based on hidden Markov cardiac cycles, characterized in that... The method includes the following steps: Step 1: Acquire heart sound signals and preprocess them to obtain clean heart sound signals; Step 2: Hilbert extracts the signal envelope; Heart sound signals after step one preprocessing Perform a Hilbert transform to obtain Its definition is: (1) in It is a heart sound signal. Represents a fixed time value. Indicates time; Therefore, the Hilbert transform is essentially an idealized 90-degree phase shifter; it transforms the heart sound signal... As the real part, its Hilbert transformation As the imaginary part, it constitutes a complex signal. That is The analytic signal is expressed as: (2) right Modulus calculation yields heart sound signals. The envelope; Step 3: Based on the preset baseline of extreme values ​​in different leads, obtain the locations of the first heart sound S1 peak and the second heart sound S2 peak after Hilbert envelope extraction; specifically: 3-1 The peak position of heart sounds varies greatly at different auscultation sites, so the maximum and minimum values ​​of a certain heart sound in the audio range after Hilbert envelope extraction are statistically analyzed. 3-2 Determine the range of the baseline value based on different extreme values. For example, for heart sounds acquired at the auscultation position (AV), the range of the envelope extreme value is [0.06-a, 0.06+a], where 'a' represents the fluctuation value due to individual differences. Therefore, the calibration line is set to [0.008-a, 0.008+a]. For heart sounds acquired at the auscultation positions (MV and TV), the range of the envelope extreme value is [0.015-a, 0.015+a]. Therefore, the calibration line is set to [0.05-a, 0.05+a]. For heart sounds acquired at the auscultation position (PV), the range of the envelope extreme value is [0.3-a, 0.3+a]. Therefore, the calibration line is set to [0.1-a, 0.1+a]. 3-3 Extract the peak values ​​above the baseline position as the first heart sound S1 peak value and the second heart sound S2 peak value; Step 4: Peak location based on cardiac cycle; Based on the characteristics of heart sound signals, the diastolic phase is longer than the systolic phase in a normal cardiac state. Since the periodic changes in heart sounds cause S1, systolic, S2, and diastolic phases to appear sequentially and periodically, the signal peaks S1 and S2 also appear adjacent to each other. Therefore, the peak correspondence between S1 and S2 can be determined, and the distance between each peak can be calculated. Let a certain peak value be , This indicates the heart sound peak number, with the peak value to its left being... distance Duration is Its right peak distance Duration is ,Compare and Size, if Then identify the peak value. For S1; if Then identify the peak value. Let S2 be the peak value. Then, the positions of S1 and S2 can be determined based on the relationship between the peak values. Step 5: Diastolic extraction based on an improved hidden Markov cardiac cycle; After extracting the Hilbert envelope, the heart sounds are used as the observation sequence, and the four states of the heart sounds are used as the hidden states, denoted as set. ,in S1, Indicates the systolic phase, S2, Indicating diastole, the parameter... This is a property of the Hidden Markov Model, used to indicate that the next state of the heart sound signal after Hilbert envelope extraction depends only on the state occupied in the current time. The overall representation is as follows: (3) in Let represent the state transition probability matrix, which determines the state sequence. (4) in Indicates from state to state The probability of transition, This represents the state of the model at time t; At this point, based on the quasi-periodic biological signal generated by the regular vibration of heart sounds, which always cycles through four states—S1, systole, S2, and diastole—the state transition probability matrix is... Represented as: (5) B represents the observation state probability matrix, which determines the observation sequence. Let the set of observation value sequences be... , ,in It is in state Time observation symbol The probability of the output; Let the initial state probability set be denoted as . (6) Since the actual PCG signals are acquired at any state during the cardiac cycle, but the duration of each PCG signal interval is not uniform, the initial state probability distribution of the four states—S1, systole, S2, and diastole—is determined based on the characteristics of the PCG signal. , , , They are as follows: (7) At this time (8) in This represents the properties of the improved Hidden Markov Model cardiac cycle. ={ , , , }; Step 6: Use the improved Viterbi algorithm to locate the optimal time span of heart sound signals S1 and S2; 6-1 Initialize the flag k=0; 6-2 The heart sound at a certain sampling point after Hilbert envelope extraction is calculated according to formula (10). ,according to Determine if the value with the highest probability is If yes, update the current label k=k+1; otherwise, label k=0. Then proceed to step 6-3, and repeat step 6-2 for the next sampling point. Corresponding to S1, Corresponding to S2; 6-3 Set a minimum state duration threshold g. If the number of consecutive non-zero markers k is greater than or equal to the threshold g, then the heart sound segment corresponding to the current consecutive non-zero marker k is considered to be... Find the interval and obtain the duration L of the current interval; if the number of consecutive non-zero markers k is less than the threshold g, discard the value and consider it as the duration of an incomplete interval; 6-4 Calculate the current duration L obtained above. The probability of it being in the specified interval; (9) (10) (11) in express The forward probability of the m-th sampling point in the interval; This represents the mean; Since the locations of the peaks S1 and S2 are known, but the correspondence between the durations of S1 and S2 and the peaks is unclear, i.e., the time span of the peaks, we approximate the time spans of S1 and S2 by expectation. (12) Step 7: Use the time span obtained in Step 6 The peak locations of S1 and S2, determined in step four, are used to segment the original heart sound signal.

2. The method according to claim 1, characterized in that... The preprocessing described in step one includes baseline calibration, wavelet denoising, and normalization.

3. The method according to claim 2, characterized in that... The preprocessing specifically includes: First, baseline calibration is performed to correct the position of drifting heart sound signals. Secondly, discrete wavelet transform is used for wavelet decomposition and reconstruction, which significantly reduces the noise component in the processed wavelet detail coefficients. Finally, normalization was performed to obtain the standardized PCG signal.

4. A heart sound segmentation system implementing the method of any one of claims 1-3, characterized in that... include: The data acquisition and preprocessing module is used to acquire heart sound signals, preprocess them, and obtain clean heart sound signals. The Hilbert envelope processing module extracts the Hilbert envelope from the heart sound signals output by the data acquisition and preprocessing module. The peak extraction module extracts the peak values ​​of the first heart sound S1 and the second heart sound S2 from the heart sounds after extracting the Hilbert envelope. The peak localization module performs peak localization of heart sounds based on the cardiac cycle after extracting the Hilbert envelope; The optimal time span calculation module uses the improved Viterbi algorithm to locate the optimal time span of the first heart sound S1 and the second heart sound S2 in the heart sound signal. The segmentation module uses the time span output by the optimal time span calculation module and the peak positioning positions of S1 and S2 output by the peak positioning module to segment the heart sound signal output by the data acquisition and preprocessing module.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that... When the computer program is executed in the computer, it causes the computer to perform the method according to any one of claims 1-3.

6. A computing device, comprising a memory and a processor, characterized in that... The memory stores executable code, and when the processor executes the executable code, it implements the method of any one of claims 1-3.