Magnetocardiogram signal superposition average optimization method based on cardiac beat classification
Through technical means such as heartbeat classification, digital filters, and independent component analysis, the problem of the influence of abnormal signals in the superposition averaging method of cardiac magnetic signals is solved, and more accurate cardiac activity detection is achieved.
Patent Information
- Application Number
- CN202410680962.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-05-29
AI Technical Summary
The superimposed average method of cardiac magnetic signals is easily affected by abnormal signals, resulting in inaccurate results and failure to correctly display P waves, QRS waves, and T waves, affecting cardiac activity detection.
A method based on heartbeat classification is adopted, by identifying and classifying irregular heartbeats, performing superposition averages respectively, using digital filters and independent component analysis methods to denoise and process the signals, combined with Pearson correlation to calculate classified heartbeats, and performing two superposition averages to improve Signal accuracy.
It improves the accuracy of superimposed averaging of cardiac magnetic signals, reduces the impact of abnormal heart beats on the results, clearly displays P waves, QRS waves and T waves, and improves the reliability of cardiac activity detection.
Smart Images

Figure CN118526202A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of processing and analyzing cardiac magnetometry signals, and in particular relates to a cardiac magnetometry signal superposition and averaging optimization method based on heartbeat classification. Background Art
[0002] As the heart contracts and expands periodically, a periodic potential difference is generated on the surface of the heart, thus generating a cardiac magnetic field. Cardiac magnetic measurement has the advantages of being non-invasive, non-contact, and having spatial resolution. It contains rich physiological and pathological information and has important clinical significance. In the processing of cardiac magnetic signals, due to the irregularity of cardiac activity and interference from the external environment, cardiac magnetic signals often contain a lot of noise, which will affect the analysis and recognition of the signal. Therefore, it is necessary to perform signal processing to extract useful information.
[0003] At present, the superposition and averaging method of the cardiac magnetometry signal is to collect synchronous cardiac magnetometry signals, and use the R wave apex of the cardiac magnetometry signal as the reference, divide the entire cardiac magnetometry data into single-cycle segments, and then perform averaging processing to achieve the purpose of noise suppression. This method can effectively improve the signal-to-noise ratio of the cardiac magnetometry signal, thereby better detecting the activity of the heart.
[0004] The superposition and averaging method of magnetic cardiotonic signals may be affected by abnormal signals, which include unprocessable external noise, muscle artifacts, and arrhythmic heartbeats. Introducing these signals into the superposition and averaging of magnetic cardiotonic signals will cause inaccurate results, making the superposition and averaging image unable to correctly display the P wave, QRS wave, and T wave, making the final result meaningless.
[0005] Therefore, it is of great significance to explore an algorithm that first classifies the heart beats and then performs superposition and averaging. Summary of the invention
[0006] In order to solve the above technical problems, the present invention provides a magnetic cardiotonic signal superposition averaging optimization method based on heart beat classification. By identifying and classifying irregular heart beats, they are superimposed and averaged separately with normal heart beats, thereby solving the problem of periodic average signal deformity caused by large differences between heart beats, thereby improving the accuracy of the superimposed average signal.
[0007] To achieve the above object, the present invention adopts the following technical solution: A method for optimizing superposition and averaging of magnetic cardiotonic signals based on heartbeat classification comprises the following steps: Step 1: De-noising the magnetic cardiotonic signal obtained by the multi-channel magnetic cardiotonic instrument; Step 2: Detect R waves and segment heart beats on the denoised magnetic heart signals; Step 3: Set the first segmented heartbeat as the initial heartbeat classification, calculate the correlation between the subsequent heartbeat and the initial heartbeat classification, and compare it with the first threshold. The heartbeat with a correlation greater than the first threshold is determined as the existing heartbeat classification, and the heartbeat with a correlation less than the first threshold is determined as a new heartbeat classification. Repeat the above steps until the correlation calculation between the subsequent heartbeat and all existing heartbeat classifications is completed; Step 4: Perform a first superposition and average calculation on the heartbeats in the same category to obtain the first superposition and average results of multiple heartbeat categories; Step 5: Calculate the correlation between the first superposition average results of multiple heartbeat classifications, merge the heartbeat classifications with high correlation and perform a second superposition average calculation to obtain a second superposition average result of the heartbeat classification.
[0008] Furthermore, in step 1, the baseline drift, high-frequency noise and power frequency noise of the magnetocardiographic signal are eliminated by using median filtering, low-pass filtering and band-stop filtering, and the noise component and signal component of the magnetocardiographic signal are separated by using the ICA method, and the noise component is set to zero and then reconstructed to obtain a denoised magnetocardiographic signal.
[0009] Furthermore, in step 2, a method combining double difference of signals and RR interval is used to locate the R wave apex of the heartbeat, and a number of sampling points are taken forward and backward from each R wave apex to obtain a corresponding complete heartbeat.
[0010] Furthermore, for each located R wave vertex, N candidate R wave vertices are set, and each candidate R wave vertex corresponds to an alternative complete heart beat.
[0011] Furthermore, step three uses Pearson correlation to calculate the correlation between the subsequent heart beat and the initial heart beat classification, including calculating the correlation between the R wave complete heart beat of the subsequent heart beat and N alternative complete heart beats and the initial heart beat classification, and obtains N+1 correlation values between the subsequent heart beat and the initial heart beat classification. The largest correlation value among the N+1 correlation values is selected and compared with the set first threshold. If it is greater than the first threshold, it is considered that the subsequent heart beat belongs to the initial heart beat classification. If it is less than the first threshold, it is considered that the subsequent heart beat belongs to a new heart beat classification; repeat the above steps until the correlation calculation of the subsequent heart beat and all existing heart beat classifications is completed.
[0012] Furthermore, the first superposition average calculation in step 4 refers to adding up all the heartbeat values in each category and then dividing by the number of heartbeats in this category to obtain multiple first superposition average results corresponding to multiple heartbeat categories.
[0013] Furthermore, step five includes calculating the Pearson correlation matrix for multiple first superposition average results, merging the categories with correlation greater than the second threshold into one category, and finally performing a second superposition average calculation on the new category to obtain a second superposition average result.
[0014] The beneficial effects of the present invention are: Aiming at the problem of periodic average signal distortion caused by the large difference between consecutive heart beats, a superposition and averaging optimization method of magnetic heart signals based on heart beat classification was provided. The method used digital filter and independent component analysis method to pre-de-noise the magnetic heart signals, and then used the signal interval double difference method to detect the R wave position. The alternative R wave vertex method was used to compensate for the offset of R wave positioning, and the Pearson correlation between heart beats was compared. The abnormal heart beats were classified before superposition and averaging, which improved the problem that the superposition and averaging results were affected by abnormal heart beats. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 This is a flow chart of the magnetic heart signal superposition and averaging optimization method based on heart beat classification of the present invention; Figure 2 This is a comparison chart of normal and abnormal magnetic heart signals, where Figure 2 (a) is a schematic diagram of normal magnetic heart signal. Figure 2 (b) is a schematic diagram of the magnetic cardiographic signal of ventricular premature beats; Figure 3 This is a schematic diagram of the results of normal and abnormal magnetic cardiology signal classification, superposition and averaging. Figure 3 (a) is a schematic diagram of normal heart beat classification. Figure 3 (b) is a schematic diagram of abnormal heart beat classification; Figure 4 This is a comparison chart of the results of classified superposition averaging and unclassified superposition averaging. DETAILED DESCRIPTION
[0016] In order to make the present invention easier to understand, the present invention is further described below with reference to the accompanying drawings and embodiments.
[0017] like Figure 1 As shown, a magnetic cardiotonic signal superposition and averaging algorithm based on heart beat classification of the present invention comprises the following steps: Step 1: De-noise the magnetic heart signal obtained by the multi-channel magnetocardiometer. The signal measured by the multi-channel magnetocardiometer contains a lot of noise. A median filter with a window length of 501 is designed to first remove the baseline drift of the signal measured by the magnetocardiometer, then connect a 50Hz 4th-order Butterworth low-pass filter in series to filter out high-frequency noise above 50Hz, and then connect a 50Hz 4th-order Butterworth notch filter in series to filter out 50Hz power frequency noise.
[0018] The noise-filtered signal is then subjected to independent component analysis. The steps of independent component analysis include: (1) Centralized processing The independent component analysis algorithm assumes that all mixed variables and independent components have zero mean, which can greatly simplify the algorithm. In practice, it is impossible to ensure that the obtained signal meets this condition, so the original observation data needs to be centered first, as shown in the following formula: , Above represents the input signal, represents the mean value of the input signal, Represents the result of the input signal after centralization. After such preprocessing, the separated independent components will also have zero mean, and the calculated mixing matrix will not change. After obtaining the separated independent components, just add the final result to restore the subtracted mean.
[0019] (2) Whitening treatment For centralized data Whitening is performed to obtain data , expressed as: , In the formula, the whitening matrix ,matrix is a diagonal matrix, given by The variance matrix of The diagonal obtained after eigenvalue decomposition is the matrix of eigenvalues, and E represents the variance matrix The matrix consisting of the eigenvectors after eigenvalue decomposition. It represents taking the square root of each element in D, and the superscript T represents the transpose of the matrix.
[0020] (3) Select the number m of independent components to be estimated m represents the number of independent components that we want to obtain. For magnetocardiogram denoising, we can choose the principal component analysis method, set the threshold according to the proportion of different eigenvalues of different principal components, and determine the number of independent components that need to be estimated. According to actual tests, 6 components can contain 99% of the magnetocardiogram signal information, so the number of estimated independent components is selected as 6.
[0021] (4) Initialize the unmixing matrix , randomly select data to initialize all , ,satisfy .
[0022] (5) For each ,renew Each element of the matrix , the rules are ,in Represents the signal source The cumulative distribution function of represent The transpose of Stands for mathematical expectation. There are three functions to choose from: , , , In the formula, the constant Take It is more appropriate, and 1 is usually taken. Suitable for recovery of super-Gaussian signal sources. Applicable to the recovery of sub-Gaussian signal sources. If the signal contains both super-Gaussian and sub-Gaussian signals, select More suitable.
[0023] (6) For the matrix Perform symmetric orthogonalization: , In the formula, yes The inverse square root of can be obtained using eigenvalue decomposition.
[0024] (7) If the result does not converge, return to step (5).
[0025] After the filtered signal is processed by ICA, 6 independent components will be obtained. The signal components are retained by visual observation, and the noise components are set to 0. The independent components are reconstructed to obtain the denoised magnetic cardiogram signal.
[0026] Step 2: Segment each heartbeat of the magnetic heart signal. Perform R wave detection on the preprocessed heartbeat sequence. The R wave detection method is as follows: (1) Detect the location of the QRS wave The magnetocardiographic data is recorded as , , where N is the total number of samples, and the first-order difference operation is performed on the data: , Then, yes Perform another difference operation and get : , Finally, Square it and get the square double difference array of the signal : , Sort the squared double difference array by magnitude in descending order, using 3% of the maximum value as the threshold. Points greater than the threshold are marked as 1, and points less than the threshold are marked as 0. The results are subjected to connectivity analysis, and continuous 1s are regarded as a QRS region, and the starting and ending points of each region are recorded. Since the maximum duration of the QRS region is 150ms, in order to eliminate the possibility of detecting multiple peaks in the same QRS region, all difference peaks within the ±75ms interval of each selected differential peak will be eliminated. The QRS region is identified as within the ±75ms window of each selected peak on the ECG data array.
[0027] (2) Detection of R wave The R wave is the positive peak in the QRS wave segment and is detected by comparing the relative amplitude of the QRS wave. Traverse and compare the amplitude of each point with the amplitudes of the two points before and after. If the amplitude of the current point is greater than the amplitudes of the two points before and after, the current point is considered to be a candidate R wave and its position and amplitude are recorded. Do not use the absolute value of the QRS band to calculate, so as not to mistakenly calculate the S wave.
[0028] (3) Optimization based on RR interval The R peak obtained in this way may not be accurate. Peaks may be missed or detected incorrectly. To ensure detection accuracy, the RR interval is processed according to specific standards. The time interval between two adjacent candidate peaks obtained in step (2) is calculated, and the mean and standard deviation of all time intervals are calculated, which are recorded as and .
[0029] The candidate R waves are screened and corrected. If the time interval between a candidate peak and the previous candidate peak is less than 0.3 seconds or greater than 1.5 seconds, the candidate peak is considered abnormal and deleted from the candidate peaks. If the time interval between a candidate peak and the previous candidate peak is greater than 1.66 times the , it is considered that an R wave peak may have been missed before the candidate peak, and the candidate peak is deleted, and a possible R wave peak is found before it and added to the candidate peak. If the amplitude of the candidate peak is less than 0.3 times the mean of the overall amplitude, the candidate peak is considered to be caused by noise and is deleted from the candidate peak. If the amplitude of the candidate peak is greater than 1.2 times the mean of the overall amplitude, the candidate peak is considered to be abnormal, and it is deleted from the candidate peak, and a possible R wave peak is found near it and added to the candidate peak.
[0030] The final candidate peak returned is the R wave position located, but the R wave vertex located by the algorithm may be biased. In order to consider the accuracy of the subsequent correlation calculation, for each R wave vertex located by the algorithm, 10 sampling points should be taken forward and backward respectively as candidate R wave vertices, and 500 sampling points should be taken forward and backward for each candidate R wave vertex to obtain the corresponding complete heartbeat. That is, for each R wave vertex located by the algorithm, there should be an actually located R wave vertex and 20 candidate R wave vertices, corresponding to an actually located heartbeat and 20 candidate heartbeats.
[0031] Step 3: Set the first segmented heartbeat as an initial heartbeat classification, and calculate the correlation between the next heartbeat and the first heartbeat. The correlation is calculated using the Pearson correlation formula: , Represents the size of each sampling point value of the first heart beat, Represents the average value of the first heartbeat sampling point, Represents the value of each sampling point of the next heartbeat, Represents the average value of the next heartbeat sampling point. The calculation of the correlation between the next heartbeat and the first heartbeat in this step means: using the R positioning heartbeat of the next heartbeat and the 20 candidate heartbeats to calculate the correlation with the first heartbeat, 21 correlation values with the initial classification will be obtained, and the largest one is selected and compared with the set first threshold. If it is greater than the first threshold, it is considered that this heartbeat belongs to the initial heartbeat classification. If the maximum value of the correlation is less than the set first threshold, it is considered that this heartbeat belongs to a new classification, and this heartbeat is added as a new classification to the subsequent calculation.
[0032] Repeat the above operation, calculate the correlation between each subsequent heartbeat and the existing heartbeat classification, use the R-located heartbeat of the subsequent heartbeat and 20 alternative heartbeats to calculate the correlation with all classified heartbeats, retain the largest correlation for each classification, and after the correlation of all classifications is calculated, select the largest correlation among all classifications for comparison with the first threshold. If it is greater than the first threshold, it is considered that this heartbeat belongs to the classification with the largest correlation. If it is less than the first threshold, this heartbeat is set as a new classification for subsequent correlation calculations.
[0033] Step 4: After the correlation calculation of all heartbeats is completed, all heartbeats in the same category are subjected to the first superposition average calculation, that is, for all heartbeats in each category, their values are added up and then divided by the number of heartbeats in this category to obtain an average value, which represents the first superposition average result of each category; Step 5: For the different first superposition average results obtained in step 4, set a new second correlation threshold, calculate the correlation between the multiple first superposition average results of step 4, merge the classifications that are higher than the second correlation threshold, and then re-perform a second superposition average calculation on the new classifications to merge similar heart beat classifications and obtain the final heart beat classification superposition average result.
[0034] Figure 2 This is a comparison diagram of normal and ventricular premature beat-containing magnetic cardiotonic signals after step 1 of this application. Figure 2 (a) is the measured human heart magnetic signal of a healthy person. Figure 2 (b) is the measured magnetic cardiotonic signal of a person with premature ventricular beats. The horizontal axis is the measurement time in seconds, and the vertical axis is the signal strength in pT. Figure 3 This is the average result of classification superposition obtained through all processes of this application. Figure 3 (a) shows the classification superposition and average results of normal magnetic cardiogram signals. Figure 3 (b) shows Figure 2 The classification, superposition and average results of the magnetic cardiomyocyte signal of ventricular premature beats. The horizontal axis is the measurement time in seconds, and the vertical axis is the signal intensity in pT. Figure 4 To compare the results of classified superposition averaging and non-classified superposition averaging, the horizontal axis is the measurement time, in s seconds, and the vertical axis is the signal intensity, in pT pico Tesla. The superposition average image of the heartbeat after classification processing can clearly show the P wave, QRS wave and T wave. However, the superposition average image without classification processing is affected by abnormal heartbeats, and its P wave, T wave, PR segment and other characteristics are significantly different from the electrocardiogram of normal people, which proves that the present invention has the ability to improve the superposition average image of the magnetic heart signal containing abnormal heartbeat components.
[0035] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for optimizing superposition and averaging of magnetic cardiotonic signals based on heartbeat classification, characterized in that: The method comprises the following steps: Step 1: De-noising the magnetic cardiotonic signal obtained by the multi-channel magnetic cardiotonic instrument; Step 2: Detect R waves and segment heart beats on the denoised magnetic heart signals; Step 3: Set the first heartbeat segmented as the initial heartbeat classification, calculate the correlation between the subsequent heartbeat and the initial heartbeat classification and compare it with the first threshold, determine the heartbeat with a correlation greater than the first threshold as the existing heartbeat classification, and determine the heartbeat with a correlation less than the first threshold as a new heartbeat classification; repeat the above steps until the calculation of the correlation between the subsequent heartbeat and all existing heartbeat classifications is completed; Step 4: Perform a first superposition and average calculation on the heartbeats in the same category to obtain a first superposition and average result of multiple heartbeat categories; Step 5: Calculate the correlation between the first superposition average results of multiple heartbeat classifications, merge the heartbeat classifications with high correlation and perform a second superposition average calculation to obtain a second superposition average result of the heartbeat classification.
2. The method for optimizing the superposition and averaging of magnetic cardiotonic signals based on heart beat classification according to claim 1, characterized in that: The step 1 includes: using median filtering, low-pass filtering and band-stop filtering to eliminate the baseline drift, high-frequency noise and power frequency noise of the magnetocardiographic signal, using the ICA method to separate the noise component and the signal component of the magnetocardiographic signal, setting the noise component to zero and then reconstructing it to obtain a denoised magnetocardiographic signal.
3. The method for optimizing the superposition and averaging of magnetic cardiotonic signals based on heart beat classification according to claim 1, characterized in that: The second step includes: using a method combining double difference of signals and RR interval to locate the R wave apex of the heartbeat, and taking a number of sampling points forward and backward from each R wave apex to obtain a corresponding complete heartbeat.
4. The method for optimizing superposition and averaging of magnetic cardiotonic signals based on heart beat classification according to claim 3, characterized in that: For each located R wave vertex, N candidate R wave vertices are set, and each candidate R wave vertex corresponds to a candidate complete heart beat.
5. The method for optimizing superposition and averaging of magnetic cardiotonic signals based on heart beat classification according to claim 1, characterized in that: In the step three: Pearson correlation is used to calculate the correlation between the subsequent heart beat and the initial heart beat classification, including the correlation between the R wave complete heart beat of the subsequent heart beat and N alternative complete heart beats and the initial heart beat classification, to obtain N+1 correlation values between the subsequent heart beat and the initial heart beat classification, and the largest correlation value among the N+1 correlation values is selected and compared with the set first threshold value, if it is greater than the first threshold value, it is considered that the subsequent heart beat belongs to the initial heart beat classification, if it is less than the first threshold value, it is considered that the subsequent heart beat belongs to a new heart beat classification; repeat the above steps until the correlation calculation between the subsequent heart beat and all existing heart beat classifications is completed.
6. The method for optimizing superposition and averaging of magnetic cardiotonic signals based on heart beat classification according to claim 1, characterized in that: In the step 4, the first superposition average calculation refers to adding up all the heartbeat values in each category and then dividing by the number of heartbeats in this category to obtain multiple first superposition average results corresponding to multiple heartbeat categories.
7. The method for optimizing superposition and averaging of magnetic cardiotonic signals based on heart beat classification according to claim 1, characterized in that: The step five includes calculating the Pearson correlation matrix for the multiple first superposition average results, merging the categories with correlation greater than the second threshold into one category, and finally performing a second superposition average calculation on the new category to obtain a second superposition average result.
Citation Information
Patent Citations
Classification method of heart beat template of dynamic electrocardiogram
CN101810476A
Magnetocardiographic signal quality assessment method and system and server
CN107753012A
Method for accurately extracting abnormal potential in QRS (quantum resonance spectrometer)
CN108523881A
QRS wave group identification method based on differential zero-crossing detection method
CN113197584A
Sleep quality monitoring system and method based on magnetocardiogram
CN113974576A
Cited By
QRS waveform fusion and deletion identification method based on magnetocardiogram multiple channels
CN122721022A
