Electrocardiosignal smoothing method based on opening and closing operation

Through the electrocardiogram smoothing method based on the open and closing operation, different components in the electrocardiogram signal are processed, and the problem of R peak amplitude attenuation in the traditional method is solved, which takes into account signal smoothing and amplitude retention, and improves the accuracy of diagnosis.

CN119606392AActive Publication Date: 2025-03-14HANGZHOU PROTON TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411644316.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-14
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

When processing ECG signals, the traditional ECG signal smoothing filtering method will cause different degrees of attenuation of the R peak amplitude, affecting the accuracy of diagnosis.

Method used

Using an electrocardiogram smoothing method based on open and closed operations, different components in the signal are gradually extracted and processed, and finally obtained a smoothing signal through signal preprocessing, peak area component acquisition, valley area component acquisition, residual component acquisition and mean filtering processing.

Benefits of technology

On the basis of smoothing the electrocardiogram signal, the amplitude of the original R peak of the signal is effectively retained, avoiding amplitude attenuation, and improving the accuracy of diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119606392A_ABST
    Figure CN119606392A_ABST
Patent Text Reader

Abstract

An electrocardiosignal smoothing method based on opening and closing operation comprises the following steps that (1) signals are preprocessed, and baseline drift components in the signals are removed; 2) acquiring a signal peak region component by adopting closed operation; 3) obtaining a signal valley value region component by adopting an open operation; 4) removing the peak value region component and the valley value region component, and obtaining residual to-be-processed components; 5) carrying out filtering processing on the residual components; and 6) superposing the components to obtain a required smoothed signal. According to the method, the electrocardiosignals are decomposed into different components through opening and closing operation, then the specific components are filtered and reconstructed, and the original amplitude of the R peak of the electrocardiosignals can be effectively reserved on the basis that the electrocardiosignals are smooth.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of electrocardiogram signal processing, in particular to an electrocardiogram signal smoothing method based on opening and closing operations. Background Art

[0002] In the process of capturing ECG signals by ECG recorders, interference from the surrounding complex environment is often encountered, resulting in multiple noise components mixed in the recorded signals. In particular, when using dry electrodes to record ECG signals, the acquired signals are often accompanied by a large amount of noise interference caused by the body's own muscle tremors. This type of noise is difficult to effectively eliminate through traditional frequency domain filtering methods, which in turn brings inconvenience to medical staff's observation and diagnosis analysis.

[0003] Most of the traditional ECG signal smoothing and filtering methods are to smooth the ECG signal as a whole. Although this method can make the ECG signal smooth, it will inevitably lead to varying degrees of attenuation of the ECG signal R peak amplitude. A small number of studies extract the R peak of the ECG signal and then smooth the signal outside the QRS complex. This method will smooth out the R peaks that have not been extracted, causing the amplitude of these R peaks to be significantly lower than the amplitude of other nearby R peaks, which in turn causes medical staff to misjudge. Since the amplitude of the peak in the ECG signal is of vital reference value for diagnosing certain heart diseases, how to maintain the integrity of the ECG signal R peak amplitude after smoothing has become a technical problem that needs to be overcome in the field of ECG signal processing algorithms. Summary of the invention

[0004] In order to overcome the shortcomings of the prior art, the present invention provides an ECG signal smoothing method based on opening and closing operations, which effectively retains the original amplitude of the R peak of the ECG signal on the basis of smoothing the ECG signal.

[0005] The technical solution adopted by the present invention to solve its technical problem is:

[0006] A method for smoothing an electrocardiogram signal based on an opening and closing operation comprises the following steps:

[0007] 1) Signal preprocessing to remove the baseline drift component in the signal;

[0008] 2) Obtaining the signal peak area component, the signal is subjected to corrosion operation and then expansion operation to obtain the signal after the closing operation, that is, the signal peak area component;

[0009] 3) Obtaining the components in the valley region of the signal: the signal is subjected to dilation operation and then corrosion operation to obtain the signal after the opening operation, that is, the components in the valley region of the signal;

[0010] 4) Residual component acquisition: according to the peak region component signal acquired in step 2) and the valley region component signal acquired in step 3), the peak region component and the valley region component in the signal are removed from the original signal, leaving the residual component signal containing muscle tremor in the baseline region;

[0011] 5) Residual component filtering processing: using the mean filtering method to filter the residual component in 4), iterating and performing the mean filtering operation K times in a loop to obtain the processed residual component RCSigPred;

[0012] 6) Obtaining a smooth signal: Component superposition, combining the three signal components with different characteristics obtained in step 2), step 3) and step 5) by addition operation in the same time domain to obtain the final required smooth signal.

[0013] Furthermore, in the step 1), a high-pass filtering method, wavelet transform or median filtering method with a fixed frequency band is used to remove the baseline drift component in the signal.

[0014] Furthermore, the process of step 2) is as follows: let a segment of signal be ecgSeg, the signal length be ecgL, define the structural element as Se, the length of Se is SeL, take a certain point in the signal as the center, cyclically search for the minimum value of the difference with the corresponding value of the structural element within the range of SeL / 2 before and after, cyclically traverse each signal point, and obtain the signal PE after the corrosion operation. Take a certain point in PE as the center, cyclically search for the maximum value of the sum of the corresponding values ​​of the structural element within the range of SeL / 2 before and after, cyclically traverse each signal point to obtain the signal PED after the closed operation, which is:

[0015] PE n = m i n {P n-SeL / 2+m -Se m ,P n},m=1,2,3,...,SeL

[0016] PE={PE1,PE2,...,PE n},n=1,2,...,ecgL

[0017] PED n =max{PE n-SeL / 2+m +Se m ,PE n},m=1,2,3,...,SeL

[0018] PED={PED1,PED2,...,PED n},n=1,2,...,ecgL

[0019] In the formula, min{} and max{} are functions for finding the minimum and maximum values, respectively. n is a point in the signal.

[0020] The process of step 3) is as follows: taking a certain point in the signal segment ecgSeg as the center, cyclically searching for the maximum value of the sum of the values ​​corresponding to the structure element within the range of SeL / 2 before and after, cyclically traversing each signal point to obtain the signal PD after the expansion operation, and then taking a point in the signal PD as the center, cyclically searching for the minimum value of the difference with the value corresponding to the structure element within the range of SeL / 2 before and after, cyclically traversing each signal point to obtain the signal PDE after the opening operation, which is:

[0021] PD n =mi n {P n-SeL / 2+m +Se m ,P n},m=1,2,3,...,SeL

[0022] PD={PD1,PD2,...,PD n},n=1,2,...,ecgL

[0023] PDEE n =max{PD n-SeL / 2+m -Se m ,PD n},m=1,2,3...SeL

[0024] PDE={PDE1,PDE2,...,PDE n},m=1,2,...,ecgL.

[0025] The process of step 4) is: according to the peak area component signal PDE obtained in step 2) and the valley area component signal PED obtained in step 3), the peak area component and the valley area component in the signal are removed from the original signal, leaving the residual component signal RCSig containing muscle tremor in the baseline area, which is:

[0026] RCSig n =P n -PED n -PED n ,

[0027] RCSig={RCSig1, RCSig2,...,RCSig n},n=1,2,...,ecgL.

[0028] In step 5), the mean filtering method adopts a five-point three-line smoothing method, which is:

[0029] n = 1, 2, ..., ecgL, k = 1, 2, ..., K

[0030] RCSigPred = f K

[0031] In the formula, a, b, and c are filtering coefficients, and RCSigPred is the residual component;

[0032] The value of K is determined according to the frequency range of the signal after mean filtering. When the cumulative energy change in the frequency domain is less than a certain threshold when the filtering range is in MHz, the filtering process is terminated.

[0033] In the present invention, the five-point three-line smoothing method is only one embodiment, and other mean filtering methods are also within the scope of the invention's rights protection.

[0034] Preferably, in step 5), the method for determining the value of K is as follows: The Fourier transform is used to obtain the frequency domain representation f of the signal y after the k-th mean filtering k of k , and the frequency sequence is X k . Then, the energy cumulative sum S of f k is obtained, and the point-by-point change amount diffS of S k is calculated. When the change amount of the cumulative energy at M Hz is less than Thr, the loop is terminated, and the value of K at this time is the required number of loop times, which is: k diffS(m) = S(m + 1) - S(m), m = 1, 2, ..., N - 1 k where e is the base of the natural logarithm and i is the imaginary unit;

[0035]

[0036] X(n) = (n * Fs) / ecgL,

[0037]

[0038] diffS(m) = S(m + 1) - S(m), m = 1, 2, ..., N - 1

[0039] where e is the base of the natural logarithm and i is the imaginary unit;

[0040] When X(n) = M Hz and diffS(n) < Thr, the loop is terminated.

[0041] In step 6), the three signal components with different characteristics obtained in step 2), step 3), and step 5) are combined with each other through addition operation in the same time domain, which is:

[0042] ecgSegFilt n = PED n + PDE n + RCSigPredn , n=1,2,...,ecgL.

[0043] The beneficial effects of the present invention are mainly manifested in that the method retains the amplitude of the original peak value of the signal on the basis of smoothing the electrocardiogram signal. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a flow chart of an ECG signal smoothing method based on opening and closing operation of the present invention;

[0045] Figure 2 It is a schematic diagram of extracting a segment of original ECG signal and peak area component in step 2) provided by the present invention;

[0046] Figure 3 It is a schematic diagram of extracting a segment of original ECG signal and valley region component in step 3) provided by the present invention;

[0047] Figure 4 is a schematic diagram of the remaining components in step 4) provided by the present invention;

[0048] Figure 5 It is a schematic diagram of the residual component after mean filtering in step 5) provided by the present invention.

[0049] Figure 6 Schematic diagram of the frequency domain representation of the signal after the residual component filtering in step 5) provided by the present invention

[0050] Figure 7 The energy accumulation and schematic diagram of the frequency domain signal in step 5) provided by the present invention is

[0051] Figure 8 The present invention provides a schematic diagram of the comparison between a smoothed signal obtained by an electrocardiogram signal smoothing method based on opening and closing operations and an original signal. DETAILED DESCRIPTION

[0052] The present invention will be further described below in conjunction with the accompanying drawings.

[0053] Reference Figures 1 to 8 A method for smoothing ECG signals based on opening and closing operations can obtain a smoothed ECG signal through signal preprocessing, acquisition of signal peak area components, acquisition of signal valley area components, acquisition of residual components, and residual component filtering, and effectively retain the ECG R peak amplitude.

[0054] like Figure 1 As shown, the ECG signal smoothing method based on opening and closing operation provided by the present invention comprises the following steps:

[0055] 1) Signal preprocessing: first, the baseline drift component in the signal is removed. A high-pass filtering method with a fixed frequency band can be used, or wavelet transform, median filtering and other methods can be used to remove the baseline drift component in the signal. The present invention adopts the median filtering method.

[0056] 2) Obtaining the signal peak area component, such as Figure 2 As shown, let a segment of the original signal be ecgSeg, the signal length be ecgL, and the nth point in the signal be P n, (n=1,2,...,ecgL). Define a structure element Se, the length of Se is SeL, and the mth point in the structure element is Se m (m=1,2,...,SeL), SeL is 0.2 times the sampling rate (sampR), that is, SeL=0.2*sampR. n As the center, the minimum difference between the corresponding structural element and the previous and next SeL / 2 is cyclically searched as P n Signal point PE after point corrosion operation n , loop through each signal point and get the signal PE after corrosion operation. Then use PE n The maximum value of the sum of the structural elements is circulated within the range of SeL / 2 before and after, and is used as the signal PED after the final closed operation. n , loop through each signal point, as follows:

[0057] PE n =mi n {P n-SeL / 2+m -Se m ,P n},m=1,2,3,...,SeL

[0058] PE={PE1,PE2,...,PE n},n=1,2,...,ecgL

[0059] PED n =max{PE n-SeL / 2+m +Se m ,PE n},m=1,2,3,...,SeL

[0060] PED={PED1,PED2,...,PED n},n=1,2,...,ecgL

[0061] Where PED is the extracted peak area component signal ( Figure 2 The signal is shown as a dotted line).

[0062] 3) Obtaining the signal valley area components; Figure 3As shown, the nth point P of the original signal segment ecgSeg n The maximum value is found within the range of SeL / 2 before and after the expansion operation as the signal PD. n , loop through each signal point to get the signal PD after the expansion operation, and then use the nth point PD of the signal PD n Centered on the SeL / 2 range, the minimum value is found in a loop as the signal PDE after the open operation. n , loop through each signal point. Specifically:

[0063] PD n =mi n {P n-SeL / 2+m +Se m ,P n},m=1,2,3,...,SeL

[0064] PD={PD1,PD2,...,PD n},n=1,2,...,ecgL

[0065] PDE n =max{PD n-SeL / 2+m -Se m ,PD n},m=1,2,3,...,SeL

[0066] PDE={PDE1,PDE2,...,PDE n},n=1,2,...,ecgL

[0067] The PDE in the formula is the extracted valley region component signal (such as Figure 3 The signal is shown as a dotted line)

[0068] 4) The remaining components are obtained, such as Figure 4 As shown, the peak area in the signal in step 2) and the valley area in step 3) are removed from the original signal, leaving the residual component signal RCSig in the baseline area, which is specifically:

[0069] RCSig n =P n -PED n -PDE n ,

[0070] RCSig={RCSig1, RCSig2,...,RCSig n},n=1,2,...,ecgL

[0071] 5) Residual component filtering, such as Figure 5As shown, the remaining component in 4) is filtered using the mean filtering method, and this operation is iteratively executed K times to obtain the processed remaining component RCSigPred. The mean filtering method uses the five-point three-line smoothing method, specifically:

[0072] n = 1, 2...ecgL, k = 1, 2,..., K

[0073] RCSigPred = y K

[0074] y in the formula k is the signal after the k-th mean filtering, and K is the total number of loop executions. a, b, and c are filtering coefficients. Here, a = -3, b = 12, c = 17; the method for determining the value of K is as follows: The frequency-domain representation f k of the signal y after the k-th mean filtering is obtained by Fourier transform k , and the frequency sequence is X k , as Figure 6 shown. Then the energy cumulative sum S k of f k is obtained, as Figure 7 shown, and the point-by-point change diffS k of S k is calculated. When the change in the cumulative energy at M Hz is less than Thr, the loop is terminated, and the value of K at this time is the required number of loop iterations.

[0075] Specifically:

[0076]

[0077] where e is the base of the natural logarithm and i is the imaginary unit.

[0078] X(n) = (n * Fs) / ecgL,

[0079]

[0080] diffS(m) = S(m + 1) - S(m), m = 1, 2,..., N - 1

[0081] When C(n) = M Hz and diffS(n) < Thr, the loop is terminated. The values here are only one embodiment, and other values are also within the scope of patent protection. Additionally, please note that the five-point three-line smoothing method is only one embodiment, and other mean filtering methods are also within the scope of patent protection of this invention.

[0082] 6) Obtaining the smoothed signal: The signal components obtained in steps 2), 3), and 5) are superimposed to obtain the finally required smoothed signal, as Figure 8The dotted line is as follows:

[0083] ecgSegFilt n =PDE n +PDE n +RCSigPred n , n=1,2,...,ecgL.

[0084] The above-described embodiments have described the technical solution of the present invention in detail. The present invention can effectively retain the original amplitude of the R peak of the ECG signal on the basis of smoothing the ECG signal.

[0085] The contents described in the embodiments of this specification are merely enumerations of implementation forms of the inventive concept and are for illustrative purposes only. The protection scope of the present invention should not be considered to be limited to the specific forms described in this embodiment, and the protection scope of the present invention also extends to equivalent technical means that can be thought of by ordinary technicians in this field based on the inventive concept.

Claims

1. A method for smoothing an ECG signal based on an opening and closing operation, characterized in that: The method comprises the following steps: 1) Signal preprocessing to remove the baseline drift component in the signal; 2) Obtaining the signal peak area component, the signal is subjected to corrosion operation and then expansion operation to obtain the signal after the closing operation, that is, the signal peak area component; 3) Obtaining the signal valley area components, the signal is subjected to dilation operation, and then corrosion operation to obtain the signal after opening operation, that is, the signal valley area components; 4) Residual component acquisition: according to the peak region component signal acquired in step 2) and the valley region component signal acquired in step 3), the peak region component and the valley region component in the signal are removed from the original signal, leaving the residual component signal containing muscle tremor in the baseline region; 5) Residual component filtering: filtering the residual component in 4) by using a mean filtering method, and performing K mean filtering operations in a loop iteration to obtain the processed residual component; 6) Obtaining a smooth signal: Component superposition, combining the three signal components with different characteristics obtained in step 2), step 3) and step 5) by addition operation in the same time domain to obtain the final required smooth signal.

2. The ECG signal smoothing method based on opening and closing operation as claimed in claim 1, characterized in that: In the step 1), a high-pass filtering method, wavelet transform or median filtering method with a fixed frequency band is used to remove the baseline drift component in the signal.

3. The ECG signal smoothing method based on opening and closing operation as claimed in claim 1 or 2, characterized in that: The process of step 2) is as follows: a segment of signal is ecgSeg, the signal length is ecgL, a structural element is defined as Se, the length of Se is SeL, a certain point in the signal is taken as the center, and the minimum value of the difference with the corresponding value of the structural element is cyclically searched within the range of SeL / 2 before and after, and each signal point is traversed to obtain the signal PE after the corrosion operation; a certain point in PE is taken as the center, and the maximum value of the sum of the corresponding values ​​of the structural element is cyclically searched within the range of SeL / 2 before and after, and each signal point is traversed to obtain the signal PED after the closed operation, which is: ON n =min{P n-SeL / 2+m -It m ,P n },m=1,2,3,...,SeL OR={OR1,OR2...OR n },n=1,2,…,ecgL PED n =max{PE n-SeL / 2+m +It m ,ON n },m=1,2,3,...,SeL PED={PED1,PED2,...,PED n },n=1,2,...,ecgL In the formula, min{} and max{} are functions for finding the minimum and maximum values, respectively. n is a point in the signal.

4. The ECG signal smoothing method based on opening and closing operation as claimed in claim 3, characterized in that: The process of step 3) is as follows: taking a certain point in the signal segment ecgSeg as the center, cyclically searching for the maximum value of the sum of the values ​​corresponding to the structure element within the range of SeL / 2 before and after, cyclically traversing each signal point to obtain the signal PD after the expansion operation, and then taking a point in the signal PD as the center, cyclically searching for the minimum value of the difference with the value corresponding to the structure element within the range of SeL / 2 before and after, cyclically traversing each signal point to obtain the signal PDE after the opening operation, which is: PD n =min{P n-SeL / 2+m +Se m ,P n },m=1,2,3,...,SeL PD={PD1,PD2,...,PD n },n=1,2,...,ecgL PDE n =max{PD n-SeL / 2+m -Se m ,PD n },m=1,2,3,...,SeL PDE={PDE1,PDE2,...,PED n },n=1,2,...,ecgL。 5. The ECG signal smoothing method based on opening and closing operation as claimed in claim 4, characterized in that: The process of step 4) is: according to the peak area component signal PED obtained in step 2) and the valley area component signal PDE obtained in step 3), the peak area component and the valley area component in the signal are removed from the original signal, leaving the residual component signal RCSig containing muscle tremor in the baseline area, which is: RCSig n =P n -PED n -PDE n , RCSig={RCSig1,RCSig2,...,RCSig n },n=1,2,...,ecgL。 6. The ECG signal smoothing method based on opening and closing operation as claimed in claim 5, characterized in that: In step 5), the mean filtering method adopts a five-point three-line smoothing method, which is: n=1,2,...,ecgL,k=1,2,...,K RCSigPred=f K Where a, b, c are filter coefficients, and RCSigPred is the residual component; The K value is determined based on the frequency range of the signal after mean filtering. When the frequency domain cumulative energy change when the filtering range is MHz is less than a certain threshold, the filtering process is terminated.

7. The ECG signal smoothing method based on opening and closing operation as claimed in claim 6, characterized in that: In step 5), the method for determining the K value is as follows: Fourier transform is used to obtain the signal y after the k-th mean filtering. k The frequency domain representation of f k , the frequency sequence is X k , then get f k The energy accumulation and S k , calculate S k The point-by-point change diffS k , when the cumulative energy change in M ​​Hz is less than Thr, the cycle is terminated. The K value at this time is the required number of cycles, which is: X(n)=(n*Fs) / ecgL, diffS(m) = S(m + 1) - S(m), m = 1, 2, ..., N - 1 where e is the base of the natural logarithm and i is the imaginary unit; When X(n) = M Hz and diffS(n) < Thr, the loop is terminated.

8. The ECG signal smoothing method based on opening and closing operation as claimed in claim 6, characterized in that: In step 6), the three signal components with different characteristics obtained in step 2), step 3) and step 5) are combined with each other through addition operation in the same time domain, which is: ecgSegFilt n =PED n +PDE n +RCSigPred n ,n=1,2,...,ecgL。

Citation Information

Patent Citations

  • Photoelectric volume wave-based breathing rate monitoring method

    CN101732050A

  • Apparatus and method for recording a vital parameter

    CN102238898A

  • Old people daily activity monitoring method based on one-dimensional convolutional neural network

    CN110916672A

  • Method and apparatus for determining whether R-wave detection should be classified as error

    CN115600078A

  • ID2018S00994A