A p-wave recognition method, storage medium and device
Patent Information
- Application Number
- CN202311232148.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-09-22
AI Technical Summary
但局部模极大值的位置容易受干扰的影响,定位精度的稳定性难以保证
[0049]本发明从心电信号中得到QRS波信息,从而确定P波检测区间。再利用算法对心电信号进行Mexican-hat小波变换,得到心电小波信号。将P波检测区间中的模极大值和心电小波信号进行翼型函数变换,得到翼型心电波形。判断翼型心电波形是否符合第一预设鉴定阈值和第二鉴定阈值的要求,进一步得到P波峰点及P波形态。再通过P波峰点及P波形态得到P波弧度和P波宽度,并与预设P波弧度和预设P波宽度进行对比,得到识别结果。因此,本发明通过多层小波变换,可以进一步拆解信号的细节,将信号的各个频率成分逐层分析,获得更加详细和全面的信号特征,从而可以精确检测p波形态,有效减少了p波的误检,提升P波定位精度的稳定性。
Smart Images

Figure CN117357127B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical technology, and in particular relates to a P-wave identification method, storage medium, and device. Background Technology
[0002] Common P-wave morphologies include upright P-waves, inverted P-waves, flat P-waves, biphasic P-waves, biphasic P-waves, and tall P-waves. In existing P-wave detection techniques, most studies use a fixed-ratio search window after locating the QRS complex. This method has limitations when identifying P-waves with significant RR interval fluctuations. The core strategy of this approach is to determine the P-wave by finding local modulus maxima within a fixed range before the R-wave after determining its location. However, the location of these local modulus maxima is easily affected by interference, making it difficult to guarantee the stability of the positioning accuracy. Summary of the Invention
[0003] In view of the above problems, the present invention provides a P-wave identification method, storage medium and device that can ensure the accuracy and stability of P-wave positioning.
[0004] The technical solution adopted in this invention is: a P-wave identification method, comprising the following steps:
[0005] Locate the QRS wave from the electrocardiogram signal to obtain QRS wave information;
[0006] The P-wave detection interval is determined based on the QRS wave information;
[0007] The electrocardiogram (ECG) signal was subjected to Mexican-hat wavelet transform using an algorithm to obtain an ECG wavelet signal.
[0008] Determine whether a modulus maxima exists within the P-wave detection interval in the preset scale; if the modulus maxima exists within the P-wave detection interval, perform a wing-shaped function transform on the ECG wavelet signal located between the modulus maxima and the right boundary of the P-wave detection interval to obtain a wing-shaped ECG waveform; 1.
[0009] Determine whether the amplitude of the wing-shaped electrocardiogram waveform meets the first preset identification threshold. If the amplitude of the wing-shaped electrocardiogram waveform meets the first preset identification threshold, then use the second identification threshold and the wing-shaped electrocardiogram waveform to obtain the P wave peak and P wave morphology.
[0010] Calculate the P-wave arc and P-wave width based on the P-wave peak and the P-wave morphology;
[0011] The P-wave radius and P-wave width are compared with preset P-wave radius and preset P-wave width to obtain the recognition result.
[0012] Preferably, the step of performing Mexican-hat wavelet transform on the electrocardiogram (ECG) signal using an algorithm to obtain an ECG wavelet signal includes:
[0013] The electrocardiogram signal is decomposed layer by layer into first wavelet coefficients of multiple scales and locations according to a preset number of decomposition layers to obtain the first wavelet coefficient matrix.
[0014] Perform wavelet transform on the first wavelet coefficient matrix according to the preset decomposition level, so that each scale and position has a corresponding second wavelet coefficient;
[0015] Based on the scale and the position, the second wavelet coefficients are convolved using the Mexican hat wavelet kernel function to obtain the wavelet transform coefficients of the wavelet coefficients.
[0016] The wavelet transform coefficients are recombined into a second wavelet coefficient matrix according to the scale and the position;
[0017] The second wavelet coefficient matrix is inversely transformed to the time domain to obtain the electrocardiogram wavelet signal.
[0018] Preferably, the Mexican hat wavelet kernel function expression is as follows:
[0019]
[0020] In the formula, t represents time; σ represents the preset scale.
[0021] Preferably, the step of calculating the P-wave curvature and P-wave width based on the P-wave peak and P-wave morphology includes:
[0022] Based on the P-wave morphology, the length from the start point to the end point of the P-wave is determined, and the P-wave width is obtained.
[0023] The P-wave height is obtained by calculating the distance from the P-wave crest to the line connecting the start and end points of the P-wave.
[0024] The ratio of the P-wave height to the P-wave width is the P-wave radian.
[0025] Preferably, the airfoil function transformation formula is as follows:
[0026] W1(i)=S i-Len -S i
[0027] W2(i)=S i -S i+Len
[0028] wing(i) = W1(i) * W2(i)
[0029] Where wing(i) is the airfoil function value; S i S is the amplitude at point i; i-Len S represents the magnitude of the first Len points before the i-th point; i+Len W1(i) is the amplitude of Len points after point i; W2(i) is the difference between the amplitude of Len points before point i and the amplitude of point i; i is the difference between the amplitude of point i and the amplitude of Len points after point i; i is a point on the ECG wavelet signal between the modulus maxima and the right boundary of the P-wave detection interval.
[0030] Preferably, the step of determining whether the amplitude of the wing-shaped electrocardiogram waveform meets the first preset identification threshold, and if the amplitude of the wing-shaped electrocardiogram waveform meets the first preset identification threshold, then using the second identification threshold and the wing-shaped electrocardiogram waveform, the P wave peak and P wave morphology are obtained, including:
[0031] Obtain the amplitude of the airfoil-shaped electrocardiogram waveform;
[0032] Determine whether the amplitude of the wing-shaped electrocardiogram waveform meets the first preset identification threshold; if the amplitude of the wing-shaped electrocardiogram waveform does not meet the first preset identification threshold, it is considered that there is no P wave in the electrocardiogram signal;
[0033] If the amplitude of the airfoil ECG waveform meets the first preset identification threshold, then the amplitude of the lowest point of the airfoil ECG waveform is obtained.
[0034] The second identification threshold is set as half of the amplitude at the lowest point.
[0035] The wavelength within the P-wave detection interval is calculated using the intersection of the line of the second identification threshold and the wing-shaped ECG waveform, and the wave number is calculated based on the maximum wavelength within the P-wave detection interval.
[0036] Based on the wave number and the wing-shaped ECG waveform, the P wave peak and the P wave morphology are obtained.
[0037] Preferably, before locating the QRS wave from the electrocardiogram signal and obtaining the QRS wave information, the following steps are included:
[0038] Obtain the raw electrocardiogram signal;
[0039] The original electrocardiogram (ECG) signal is denoised and amplified to obtain a denoised ECG signal;
[0040] The amplitude of the denoised ECG signal is normalized to obtain a normalized signal;
[0041] The electrocardiogram signal is obtained by squaring the amplitude of the normalized signal.
[0042] Preferably, determining the P-wave detection interval based on the QRS wave information includes:
[0043] Obtain the RR interval from the QRS wave information;
[0044] Calculate the average interval of RR based on the RR interval within a preset time period;
[0045] The search range of the P-wave is adjusted by the average interval to obtain the P-wave detection range.
[0046] A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the method as described above.
[0047] A computer device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described above.
[0048] The embodiments of the present invention have the following beneficial effects:
[0049] This invention obtains QRS wave information from electrocardiogram (ECG) signals to determine the P-wave detection interval. Then, an algorithm is used to perform Mexican-hat wavelet transform on the ECG signal to obtain an ECG wavelet signal. The modulus maxima in the P-wave detection interval and the ECG wavelet signal are then subjected to an airfoil function transform to obtain an airfoil ECG waveform. The airfoil ECG waveform is then judged to meet the requirements of a first preset identification threshold and a second preset identification threshold, further obtaining the P-wave peak and P-wave morphology. The P-wave curvature and P-wave width are then obtained from the P-wave peak and P-wave morphology and compared with preset P-wave curvature and preset P-wave width to obtain the recognition result. Therefore, this invention, through multi-layer wavelet transform, can further decompose the signal details, analyze each frequency component of the signal layer by layer, obtain more detailed and comprehensive signal features, thereby accurately detecting the P-wave morphology, effectively reducing false detections of the P-wave, and improving the stability of P-wave positioning accuracy. Attached Figure Description
[0050] 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 only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] in:
[0052] Figure 1 This is a flowchart of a P-wave identification method in one embodiment;
[0053] Figure 2 This is a diagram of the internal structure of a computer device in one embodiment.
[0054] The present invention will be further explained below with reference to the accompanying drawings and embodiments. Detailed Implementation
[0055] 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, and 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.
[0056] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0057] The P-wave identification method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0058] This application provides a P-wave identification method. Figure 1 This is a flowchart of a P-wave identification method in one embodiment. For example... Figure 1 As shown, the P-wave identification method includes the following steps:
[0059] Step S101: Locate the QRS wave from the electrocardiogram signal and obtain QRS wave information.
[0060] Specifically, R-wave peak detection is performed on the electrocardiogram (ECG) signal. The R-wave is typically the highest peak in the QRS complex, so this step aims to detect the location of the R-peak in the signal. Commonly used methods include threshold detection, slope change detection, and waveform template matching. These methods can detect peaks based on specific algorithms and parameter settings.
[0061] After the R-wave peak is detected, the QRS waveform characteristics can be used to find the QRS wave start and end points and calculate the RR interval.
[0062] Step S102: Determine the P-wave detection interval based on the QRS wave information.
[0063] Based on the timing relationship between the QRS complex and the P wave in the electrocardiogram, an appropriate detection window can be determined to locate the onset of the P wave. Generally, the search can be conducted within a certain time range before the R peak, typically with a window size of 0.04-0.2 seconds. The specific window size can be varied according to changes in the RR interval.
[0064] Step S103: Use the algorithm to perform Mexican-hat wavelet transform on the electrocardiogram signal to obtain the electrocardiogram wavelet signal.
[0065] It should be noted that the Mexican-hat wavelet is symmetrical about the origin and identifies the singular points of the original signal. The method is simple, the location is accurate, and it is suitable for analyzing signals with peaks and troughs. It has good time-frequency localization characteristics and is suitable for analyzing short-term features in electrocardiogram signals.
[0066] Furthermore, wavelet transform can be implemented using different algorithms, such as the fast wavelet transform algorithm. The fast wavelet transform algorithm decomposes the signal into wavelet coefficients at different scales and locations to extract the time-frequency information of the signal. In this embodiment, the Mallat algorithm is used. The Mallat algorithm is a classic wavelet transform algorithm used to convert signals to the wavelet domain. The Mallat algorithm has the advantages of fast computation, high efficiency, and stability, which can improve the stability and efficiency of P-wave identification.
[0067] Step S104: Determine whether there is a modulus maxima in the P-wave detection interval within the preset scale; if there is a modulus maxima in the P-wave detection interval, perform an airfoil function transformation on the ECG wavelet signal located between the modulus maxima and the right boundary of the P-wave detection interval to obtain an airfoil ECG waveform.
[0068] Specifically, after performing Mexican-hat wavelet transform on the signal using the Mallat algorithm, a suitable scale (the scale where the P-wave energy mainly falls) is selected to find the modulus maxima with opposite signs within the P-wave detection interval. If a modulus maxima exists, a P-wave may be present. Further checks are needed to see if the same modulus maxima also exists at nearby scales. If not, it is assumed that there is no P-wave in the ECG signal.
[0069] It should be noted that multiple scales can be referenced for the modulus maxima of wavelet transform to reduce false detections.
[0070] Step S105: Determine whether the amplitude of the wing-shaped ECG waveform meets the first preset identification threshold. If the amplitude of the wing-shaped ECG waveform meets the first preset identification threshold, then use the second identification threshold and the wing-shaped ECG waveform to obtain the P wave peak and P wave morphology.
[0071] It should be noted that the first preset identification threshold can be a fixed amplitude. This threshold is used to identify the presence of a P wave on the current wing-shaped ECG waveform. If the amplitude of the wing-shaped ECG waveform does not meet the first preset threshold, the ECG signal is considered to lack a P wave. When the amplitude of the P wave in the wing-shaped ECG waveform exceeds this threshold, the P wave is considered to be present.
[0072] Furthermore, the first preset identification threshold can also be a percentage threshold. Based on the relative change in the P-wave amplitude of the airfoil function, a percentage threshold can be set. When the increase or decrease in the P-wave amplitude relative to the baseline or reference value exceeds the set percentage threshold, the P-wave is considered to exist.
[0073] Step S106: Calculate the P-wave curvature and P-wave width based on the P-wave peak and P-wave morphology.
[0074] Specifically, when calculating the radian and width of the P-wave, it may be necessary to smooth the P-wave curve to reduce the influence of noise and subtle fluctuations, thereby obtaining more reliable results. Furthermore, the calculation of the P-wave's radian and width can also be based on specific algorithms and models, such as using machine learning methods for analysis and prediction.
[0075] Step S107: Compare the P-wave curvature and P-wave width with the preset P-wave curvature and preset P-wave width to obtain the recognition result.
[0076] Specifically, firstly, the calculated P-wave width is compared with a preset P-wave width. If the width is within the preset range or close to the preset value, the P-wave duration is considered to meet the preset conditions. Then, the calculated P-wave curvature is compared with a preset P-wave curvature. If the curvature is within the preset range or close to the preset value, the P-wave morphology is considered to meet the preset conditions. If both the P-wave curvature and width meet the preset conditions, the ECG signal is considered to contain a P-wave. If neither the P-wave curvature nor the width meets the preset conditions, the ECG signal is considered to lack a P-wave.
[0077] This application dynamically confirms the P-wave detection interval based on QRS wave information and references modulus maxima at multiple scales when performing wavelet transform. Therefore, this application can correct the problems in the prior art where the location of local modulus maxima is easily disturbed and the stability of positioning accuracy is difficult to guarantee, thereby reducing the false detection rate in P-wave identification.
[0078] In one feasible embodiment, an algorithm is used to perform Mexican-hat wavelet transform on the electrocardiogram (ECG) signal to obtain an ECG wavelet signal, including:
[0079] The electrocardiogram signal is decomposed layer by layer into first wavelet coefficients of multiple scales and locations according to a preset number of decomposition layers, thus obtaining the first wavelet coefficient matrix.
[0080] It should be noted that Mexican-hat wavelets are used to perform wavelet transform on the electrocardiogram signal. Wavelet transform can be performed using either discrete or continuous wavelet transform. The wavelet-transformed signal is then decomposed to obtain wavelet coefficients at different scales and locations. Generally, each level of decomposition produces one approximation coefficient and several detail coefficients. The first wavelet coefficient matrix refers to the detail coefficients of the first level. These first-level detail coefficients are then combined according to their location and scale in a predetermined manner to form the first wavelet coefficient matrix.
[0081] Perform wavelet transform on the first wavelet coefficient matrix according to a preset number of decomposition levels, so that there are corresponding second wavelet coefficients at each scale and position.
[0082] It's important to note that the number of decomposition levels needs to be determined when performing wavelet transform. The number of decomposition levels determines how many scale and frequency components the signal is decomposed into. Typically, wavelet transform involves multiple iterative low-pass and high-pass filtering operations on the signal, using the low-frequency component obtained after each filtering as the input for the next iteration. Therefore, each iteration produces a low-frequency subband and a high-frequency subband. Depending on the number of iterations, different numbers of wavelet transform levels can be obtained. Each level represents a scale, and different levels of wavelet transform yield corresponding second wavelet coefficients.
[0083] Based on the scale and location, the second wavelet coefficients are convolved using the Mexican hat wavelet kernel function to obtain the wavelet transform coefficients of the wavelet coefficients.
[0084] Specifically, the wavelet transform coefficients are Mexican Hat wavelet transform coefficients. Wavelet transform coefficients are projections of the wavelet basis onto the data and are used to describe the local features of the data. By convolving the second wavelet coefficients with the Mexican Hat wavelet kernel function, clearer and more accurate local features of the ECG signal can be obtained.
[0085] The wavelet transform coefficients are recombined into a second wavelet coefficient matrix according to scale and position.
[0086] It should be noted that by recombining the wavelet transform coefficients according to scale and position, the decomposed wavelet coefficient matrix can be reconstructed. The reconstructed wavelet coefficient matrix is the second wavelet coefficient matrix.
[0087] The second wavelet coefficient matrix is inversely transformed to the time domain to obtain the electrocardiogram wavelet signal.
[0088] It should be noted that, in this embodiment, the inverse wavelet transform formula is used to convert the wavelet coefficients back to the electrocardiogram signal. The inverse wavelet transform provides a method for converting from the frequency domain to the time domain, and can recover the detailed information of the electrocardiogram signal from the second wavelet coefficient matrix.
[0089] In a feasible embodiment, the Mexican hat wavelet kernel function is expressed as follows:
[0090]
[0091] In the formula, t represents time; σ represents the preset scale.
[0092] Furthermore, the Mexican hat wavelet kernel function expression can be simplified to:
[0093]
[0094] In the formula, t represents time.
[0095] In one feasible embodiment, calculating the P-wave curvature and P-wave width based on the P-wave peak and P-wave morphology includes:
[0096] The length from the start to the end of the P-wave is determined by the P-wave morphology, and the P-wave width is obtained.
[0097] Specifically, the P wave can be positive, negative, bidirectional (positive and negative), or bidirectional (negative and positive). The direction of the P wave varies in different leads. A P wave above the baseline is called a positive P wave; a P wave below the baseline is called a negative P wave. The P wave begins after the U wave and ends at the beginning of the QRS complex.
[0098] The height of the P-wave is obtained by calculating the distance from the P-wave crest to the line connecting the start and end points of the P-wave.
[0099] Specifically, first connect the start and end points of the P-wave to form the start-end line of the P-wave, then calculate the distance from the peak of the P-wave to the start-end line. When the P-wave has two peaks, use the higher peak as the peak for calculation. If the peak of the P-wave in the normal direction is located at a certain position on the time axis, while the peak of the P-wave in the reverse direction is located at another position on the time axis, then the peak position of the bidirectional P-wave is the midpoint between the two peak positions.
[0100] The ratio of P-wave height to P-wave peak is the P-wave radian.
[0101] The P-wave radian is equal to the P-wave height divided by the P-wave width. A larger P-wave height divided by the P-wave width indicates a larger radian, while a smaller P-wave height divided by the P-wave width indicates a smaller radian.
[0102] In one feasible embodiment, the airfoil function transformation formula is as follows:
[0103] W1(i)=S i-Len -S i
[0104] W2(i)=Si -S i+Len
[0105] wing(i) = W1(i) * W2(i)
[0106] Where wing(i) is the airfoil function value; S i S is the amplitude at point i; i-Len S represents the magnitude of the first Len points before the i-th point; i+Len W1(i) represents the amplitude of Len points after point i; W2(i) represents the difference between the amplitude of Len points before point i and the amplitude of point i; i represents the difference between the amplitude of point i and the amplitude of Len points after point i; i represents the point on the ECG wavelet signal between the modulus maxima and the right boundary of the P-wave detection interval.
[0107] Specifically, the value of Len can be 0.04×fs, where fs is the sampling rate of the ECG signal, representing how many sampling points correspond to per second, and is generally taken as 250Hz or 500Hz.
[0108] In one feasible embodiment, it is determined whether the amplitude of the wing-shaped electrocardiogram waveform meets a first preset identification threshold. If the amplitude of the wing-shaped electrocardiogram waveform meets the first preset identification threshold, then the P wave peak and P wave morphology are obtained using a second identification threshold and the wing-shaped electrocardiogram waveform, including:
[0109] Obtain the amplitude of the airfoil-shaped electrocardiogram waveform.
[0110] Determine whether the amplitude of the wing-shaped ECG waveform meets the first preset identification threshold; if the amplitude of the wing-shaped ECG waveform does not meet the first preset identification threshold, it is considered that there is no P wave in the ECG signal.
[0111] Specifically, statistical methods can be used to set a first preset threshold for identifying the presence of the P wave in a winged ECG waveform based on characteristics of the dataset, such as mean, standard deviation, and extreme values. Alternatively, the first preset threshold can be obtained by analyzing statistical data from normal ECG samples or references. If the wavelet transform exhibits a modulus maxima and the lowest point of the winged ECG waveform exceeds the set first preset threshold, then a P wave is considered to be present.
[0112] If the amplitude of the airfoil ECG waveform meets the first preset identification threshold, then the amplitude of the lowest point of the airfoil ECG waveform is obtained.
[0113] The second identification threshold is set as half of the lowest point amplitude.
[0114] Specifically, the second identification threshold is half of the lowest point amplitude, used to determine whether the P wave is a unidirectional P wave or a bidirectional P wave.
[0115] The wavelength within the P-wave detection interval is calculated using the intersection of the line of the second identification threshold and the wing-shaped ECG waveform, and the wave number is calculated based on the maximum wavelength within the P-wave detection interval.
[0116] Specifically, the intersection of the line of the second identification threshold and the wing-shaped ECG waveform is determined, and the width of the wing-shaped ECG waveform is calculated. When the width value is greater than 0.7 times the maximum width value within the P wave detection interval, one wave number is counted.
[0117] Based on the wave number and wing-shaped ECG waveform, the P wave peak and P wave morphology are obtained.
[0118] Specifically, if the wave number that meets the above conditions is 1, it is considered a unidirectional P-wave; if the wave number that meets the above conditions is 2, it is considered a bidirectional P-wave.
[0119] Furthermore, since the wing-shaped ECG waveform falls within the P-wave detection interval, the length of the wing-shaped ECG waveform is determined as follows:
[0120]
[0121] In the formula, fs is the sampling rate of the ECG signal, WL is the length of the data segment within the P wave detection interval, and L is the length of the wing-shaped ECG waveform.
[0122] In one feasible embodiment, before locating the QRS wave from the electrocardiogram signal and obtaining QRS wave information, the following steps are included:
[0123] Obtain the raw electrocardiogram signal.
[0124] It should be noted that the raw electrocardiogram signal can be obtained either in real time or in advance.
[0125] The original electrocardiogram (ECG) signal is denoised and amplified to obtain a denoised ECG signal.
[0126] In this embodiment, since the energy of the QRS composite wave is mainly concentrated around 8 to 16 Hz and the peak energy of the p wave is mainly concentrated around 3 to 12 Hz, the signal is passed through a bandpass filter with a center frequency of 10 Hz to remove power frequency interference and noise interference, thereby enhancing the QRS wave and p wave.
[0127] The amplitude of the denoised ECG signal is normalized to obtain a normalized signal.
[0128] Specifically, normalizing the amplitude of the denoised ECG signal can avoid the influence of slight differences in amplitude between different types of heartbeats on the results.
[0129] The electrocardiogram (ECG) signal is obtained by squaring the amplitude of the normalized signal.
[0130] The amplitude of the normalized signal is squared, making large values larger and small values smaller, thus obtaining an ECG signal with more obvious ECG characteristics.
[0131] In one feasible embodiment, determining the P-wave detection interval based on QRS wave information includes:
[0132] Obtain the RR interval from the QRS wave information.
[0133] The average interval of RR is calculated based on the RR interval within a preset time period.
[0134] Specifically, based on the detected R wave, the average interval of the RR is calculated according to the RR of the preceding 30 seconds.
[0135] The P-wave detection range is obtained by adjusting the search range of the P-wave through the average interval.
[0136] Specifically, the P wave is searched within a variable window preceding the QRS complex. The variable window settings and the left and right boundaries of the P wave detection interval are as follows:
[0137]
[0138] In the formula, R(i) represents the position of the i-th R peak; RR(i-1) represents the (i-1)-th RR interval; is the average interval of the RR interval within 30 seconds, Fs is the sampling rate of the ECG signal; w is the P wave detection interval.
[0139] In one embodiment, the P-wave identification method includes the following steps:
[0140] Acquire electrocardiogram (ECG) signals and perform noise reduction preprocessing on the ECG signals.
[0141] The QRS wave information in the processed ECG signal is obtained, the R peak is detected, and the RR interval is calculated.
[0142] Adjust the P-wave detection interval according to the length of the RR interval.
[0143] The algorithm is used to perform Mexican-hat wavelet transform on the ECG signal within the P-wave detection interval to obtain the ECG wavelet signal and the modulus maxima of the ECG wavelet signal at a preset scale.
[0144] The airfoil ECG waveform is obtained by performing an airfoil function transformation on the ECG wavelet signal from the first maximum point to the right boundary of the P-wave detection interval.
[0145] Determine whether a first preset identification threshold exists in the airfoil ECG waveform and obtain the amplitude of the lowest point of the airfoil ECG waveform. Calculate the second identification threshold.
[0146] The wave number of the airfoil ECG waveform is calculated based on the intersection of the second identification threshold and the airfoil ECG waveform.
[0147] Specifically, calculating the wave number of a wing-shaped electrocardiogram requires determining the width of the P wave based on the P wave peak and P wave morphology.
[0148] If the first preset identification threshold is not present in the wing-shaped ECG waveform, then it is considered that there is no P wave in the ECG signal.
[0149] If the wing-shaped ECG waveform contains a first preset identification threshold and the wave number is 1, then the wing-shaped ECG waveform is considered to be a unidirectional P wave.
[0150] If the wing-shaped ECG waveform contains a first preset identification threshold and has a wave number of 2, then the wing-shaped ECG waveform is considered to be a biphasic P wave.
[0151] If the wing-shaped ECG waveform is considered a unidirectional or bidirectional P wave, then it is determined whether the curvature of the P wave peak meets the preset P wave curvature. If the curvature of the P wave peak meets the preset P wave curvature, the current P wave is considered a true P wave. If the curvature of the P wave peak does not meet the preset P wave curvature, the current P wave is considered a false P wave.
[0152] In one embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described photovoltaic model parameter confirmation method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0153] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, it implements the various processes of the above-described photovoltaic model parameter confirmation method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0154] Figure 2 This is a diagram illustrating the internal structure of a computer device in one embodiment. This computer device can specifically be a terminal or a server. Figure 2 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a photovoltaic model parameter verification method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to perform the photovoltaic model parameter verification method. Those skilled in the art will understand that... Figure 2The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0155] Those skilled in the art will understand that implementing all or part of the processes in the above embodiments can be accomplished by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0156] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0157] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A P-wave identification method, characterized in that, Includes the following steps: Locate the QRS wave from the electrocardiogram signal to obtain QRS wave information; The P-wave detection interval is determined based on the QRS wave information; The electrocardiogram (ECG) signal was subjected to Mexican-hat wavelet transform using an algorithm to obtain an ECG wavelet signal. Determine whether there is a modulus maxima in the P-wave detection interval within the preset scale; if there is a modulus maxima in the P-wave detection interval, then perform an airfoil function transform on the ECG wavelet signal located between the modulus maxima and the right boundary of the P-wave detection interval to obtain an airfoil ECG waveform; Determine whether the amplitude of the wing-shaped electrocardiogram waveform meets the first preset identification threshold. If the amplitude of the wing-shaped electrocardiogram waveform meets the first preset identification threshold, then use the second identification threshold and the wing-shaped electrocardiogram waveform to obtain the P wave peak and P wave morphology. Calculate the P-wave arc and P-wave width based on the P-wave peak and the P-wave morphology; The P-wave radius and P-wave width are compared with preset P-wave radius and preset P-wave width to obtain the recognition result; Wherein, the step of determining whether the amplitude of the wing-shaped electrocardiogram waveform meets the first preset identification threshold, and if the amplitude of the wing-shaped electrocardiogram waveform meets the first preset identification threshold, then using the second identification threshold and the wing-shaped electrocardiogram waveform, the P wave peak and P wave morphology are obtained, including: Obtain the amplitude of the airfoil-shaped electrocardiogram waveform; Determine whether the amplitude of the wing-shaped electrocardiogram waveform meets the first preset identification threshold; if the amplitude of the wing-shaped electrocardiogram waveform does not meet the first preset identification threshold, it is considered that there is no P wave in the electrocardiogram signal; If the amplitude of the airfoil ECG waveform meets the first preset identification threshold, then the amplitude of the lowest point of the airfoil ECG waveform is obtained. The second identification threshold is set as half of the amplitude at the lowest point. The wavelength within the P-wave detection interval is calculated using the intersection of the line of the second identification threshold and the wing-shaped ECG waveform, and the wave number is calculated based on the maximum wavelength within the P-wave detection interval. Based on the wave number and the wing-shaped ECG waveform, the P wave peak and the P wave morphology are obtained.
2. The method according to claim 1, characterized in that, The method of performing Mexican-hat wavelet transform on the electrocardiogram (ECG) signal using an algorithm to obtain an ECG wavelet signal includes: The electrocardiogram signal is decomposed layer by layer into first wavelet coefficients of multiple scales and locations according to a preset number of decomposition layers to obtain the first wavelet coefficient matrix. Perform wavelet transform on the first wavelet coefficient matrix according to the preset decomposition level, so that each scale and position has a corresponding second wavelet coefficient; Based on the scale and the position, the second wavelet coefficients are convolved using the Mexican hat wavelet kernel function to obtain the wavelet transform coefficients of the wavelet coefficients. The wavelet transform coefficients are recombined into a second wavelet coefficient matrix according to the scale and the position; The second wavelet coefficient matrix is inversely transformed to the time domain to obtain the electrocardiogram wavelet signal.
3. The method according to claim 2, characterized in that, The Mexican Hat wavelet kernel function expression is as follows: In the formula, Indicates time; This indicates a preset scale.
4. The method according to claim 1, characterized in that, The calculation of the P-wave curvature and P-wave width based on the P-wave peak and P-wave morphology includes: Based on the P-wave morphology, the length from the start point to the end point of the P-wave is determined, and the P-wave width is obtained. The P-wave height is obtained by calculating the distance from the P-wave crest to the line connecting the start and end points of the P-wave. The ratio of the P-wave height to the P-wave width is the P-wave radian.
5. The method according to claim 1, characterized in that, The airfoil function transformation formula is as follows: in, These are the airfoil function values; For the first The amplitude of the point; For the first Click before The amplitude at each point; For the first After clicking The amplitude at each point; For the first Click before The magnitude of the i-th point and the i-th The difference in amplitude at the points; For the first The amplitude of the point and the first After clicking The difference in amplitude at each point; The point on the ECG wavelet signal between the modulus maxima and the right boundary of the P-wave detection interval.
6. The method according to claim 1, characterized in that, Before locating the QRS wave from the electrocardiogram signal and obtaining QRS wave information, the following steps are included: Obtain the raw electrocardiogram signal; The original electrocardiogram (ECG) signal is denoised and amplified to obtain a denoised ECG signal; The amplitude of the denoised ECG signal is normalized to obtain a normalized signal; The electrocardiogram signal is obtained by squaring the amplitude of the normalized signal.
7. The method according to claim 1, characterized in that, Determining the P-wave detection interval based on the QRS wave information includes: Obtain the RR interval from the QRS wave information; Calculate the average interval of RR based on the RR interval within a preset time period; The search range of the P-wave is adjusted by the average interval to obtain the P-wave detection range.
8. A computer-readable storage medium, characterized in that, The device stores a computer program that, when executed by a processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 7.
9. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method for detecting, distinguishing and locating P waves and T waves of electrocardiogram
CN110013247A