Magnetocardiogram P-wave detection method based on wavelet analysis and local noise adaptive threshold

By employing wavelet analysis and a local noise adaptive threshold method for P-wave detection in magnetocardiogram (MCC) signals, the accuracy and robustness issues of P-wave detection in MCC signals are resolved, achieving high sensitivity and high reliability detection in complex signal environments.

CN121587731APending Publication Date: 2026-03-03SHANGHAI SIXTH PEOPLES HOSPITAL
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511835852.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately detect P waves in magnetocardiogram (MCG) signals. In particular, low-amplitude, smooth-shaped, and low-frequency P wave signals are susceptible to baseline drift and high-frequency noise interference, resulting in insufficient detection accuracy and robustness, which limits the application of automated clinical diagnostic systems.

Method used

A magnetic resonance P-wave detection method based on wavelet analysis and local noise adaptive threshold was adopted. Baseline drift and electromyographic noise were suppressed by high-pass and low-pass filtering. Time-frequency domain analysis was performed by combining Morlet wavelet function. Adaptive threshold was generated by local noise estimation and the noise level of each cardiac cycle was dynamically adjusted to confirm the P wave.

Benefits of technology

It achieves accurate and robust detection of P waves, improves detection accuracy and reliability in complex signal environments, adapts to differences between individuals and leads, and reduces false positive and false negative errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121587731A_ABST
    Figure CN121587731A_ABST
Patent Text Reader

Abstract

The invention discloses a magnetocardiogram P-wave detection method based on wavelet analysis and a local noise self-adaptive threshold, which is characterized in that accurate and robust detection of a P wave is realized by searching on a characteristic scale which can highlight the P wave, a self-adaptive threshold confirmation mechanism based on local noise estimation is introduced, and a self-adaptive threshold confirmation mechanism is established for a time domain search window of each cardiac cycle. According to the method, the internal noise level is dynamically evaluated, and an estimated value capable of accurately reflecting the local noise condition of the current heart beat can be obtained by carrying out statistical analysis on wavelet coefficients in a characteristic scale in an area where P waves are most likely to appear.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of physiological detection technology, specifically relating to a method for detecting magnetic P-waves based on wavelet analysis and local noise adaptive threshold. Background Technology

[0002] Magnetocardiography (MCG), as an advanced non-invasive cardiac electrophysiological testing technique, provides a wealth of information for the diagnosis of heart diseases. In MCG signal analysis, the P wave represents the electrical activity of the atria, and its accurate detection is a key prerequisite for diagnosing various arrhythmias such as atrial fibrillation and atrioventricular block.

[0003] However, P-wave detection has always faced significant technical challenges. P-wave signals are characterized by low amplitude, smooth shape, and low frequency, making them highly susceptible to interference from various noises and artifacts, primarily manifested in: 1. Easily obscured by baseline drift: In long-term recordings, factors such as the subject's breathing can cause significant low-frequency baseline drift. When the P wave is superimposed on the slope of the drift, its peak characteristics become less distinct, and traditional methods based on finding local extrema easily fail.

[0004] 2. Susceptible to high-frequency noise interference: High-frequency interference such as electromyographic noise can cause a large number of spikes in the signal waveform, severely disrupting the smooth shape of the P wave, resulting in a large number of false detections in methods based on shape matching or threshold judgment.

[0005] 3. Low signal-to-noise ratio (SNR) leads to missed detections: The amplitude of the P wave itself is much smaller than that of the QRS complex, and in some individuals or leads it is even very weak. Existing methods that rely on setting a "height threshold" to distinguish between peaks and noise are prone to missed detections when processing such low SNR signals because the P wave amplitude is below the threshold.

[0006] Traditional methods mostly remain at the time-domain analysis level, using filtering and setting fixed or adaptive thresholds to find peaks. These methods essentially rely on the amplitude characteristics of the signal, which cannot effectively address the aforementioned challenges. This results in insufficient detection accuracy and robustness in complex signal environments, limiting their application in automated clinical diagnostic systems.

[0007] Furthermore, existing advanced signal processing methods still have limitations in the final step of validity assessment. They typically employ a fixed empirical threshold or a global adaptive threshold calculated based on the macroscopic energy characteristics of the entire signal. Fixed thresholds cannot adapt to differences in P-wave morphology and signal-to-noise ratio among different individuals and leads; while global thresholds cannot handle local, short-term noise fluctuations in the signal. For example, within a cardiac cycle, even if the overall signal quality is good, the PR segment may experience a momentary increase in noise level due to occasional electromyographic interference. In this case, the global threshold may be too low, resulting in false positives (false detections); conversely, when processing a heartbeat with extremely low P-wave amplitude, the global threshold may be too high, resulting in false negatives (false negatives). Summary of the Invention

[0008] The purpose of this invention is to realize a dynamic confirmation mechanism that can accurately reflect the local characteristics of each heartbeat, thereby further improving the intelligence and reliability of the detection system.

[0009] To achieve the above-mentioned objectives, the present invention provides a method for detecting magnetic P-waves based on wavelet analysis and adaptive thresholding of local noise, comprising the following steps: Single-channel MCG signal at target sampling rate High-pass and low-pass filtering were performed to obtain the filtered signal, which suppressed baseline drift and attenuated high-frequency electromyographic noise. The QRS wave initiation point was located at the sample point based on the filtered signal. Delineate each cardiac cycle As a time-domain search window; Based on the shape of the filtered signal, the mother wavelet is determined using the mother wavelet function, which is as follows:

[0010] in, For time, The imaginary unit, The center frequency; Based on the mother wavelet for single-channel MCG signals Perform continuous wavelet transform to generate time-scale complex coefficient matrix The formula is as follows:

[0011] in, It is the input signal. It is the complex conjugate of the mother wavelet. It is a scale factor inversely proportional to frequency. It is the time shift factor; Time-scale complex coefficient matrix Includes mod and phase ; Based on the physiological frequency characteristics of the P wave, the target P wave physiological frequency range for analysis is determined as follows:

[0012] By utilizing the correspondence between the mother wavelet scale and frequency, the characteristic scale range can be obtained. The formula is as follows:

[0013]

[0014] in, It is the center frequency of the mother wavelet. It is the sampling frequency of the signal; Within the two-dimensional plane defined by the time-domain search window and the feature scale range, search for the time-scale complex coefficient matrix. Maximum point Therefore, it is preliminarily determined that the central peak of the P wave is located at Locate candidate locations for the P wave; Define a noise estimation window at the beginning of the time-domain search window. Within the noise estimation window and within the feature scale range, all moduli are extracted. The standard deviation of local noise is estimated using the median absolute deviation:

[0015] in, In the time dimension and scale dimension The set of all modulo elements within; Threshold confirmation based on standard deviation estimate:

[0016] in, It is a preset sensitivity factor, representing the requirement that the P-wave signal strength be at least as low as noise. ; The validity of candidate locations for P-waves is confirmed based on a confirmation threshold. At that time, it was finally confirmed that... The location has a valid P-wave and outputs it.

[0017] Preferably, a 1Hz high-pass filter and a 40Hz low-pass filter are used.

[0018] Preferably, the center frequency in the mother wavelet function .

[0019] Preferably, the modulus represents the energy intensity of the signal near time point b in the corresponding frequency band at scale a, and the phase reflects the phase information of the signal at that time and frequency point.

[0020] This invention provides a method for detecting P-waves in cardiac magnetocardiography based on wavelet analysis and adaptive threshold for local noise. By searching on the "feature scale" that best highlights the P-wave, it achieves accurate and robust detection of the P-wave. It also introduces an adaptive threshold confirmation mechanism based on local noise estimation. For each cardiac cycle, the noise level within the "time domain search window" is dynamically evaluated. By statistically analyzing the wavelet coefficients within the feature scale in the region where the P-wave is least likely to occur, an estimate that accurately reflects the local noise situation of the current cardiac contraction can be obtained. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating the magnetocardiogram P-wave detection method based on wavelet analysis and local noise adaptive threshold provided in an embodiment of the present invention. Detailed Implementation

[0022] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined by the appended claims.

[0023] like Figure 1 As shown, this invention provides a novel P-wave detection method based on wavelet analysis and local noise adaptive thresholding. This method, based on multi-resolution wavelet analysis, is supported by the National Key Research and Development Program of China (2022YFC2407000, 2022YFC2407003) and the Shanghai Shenkang Municipal Hospital Diagnosis and Treatment Technology Promotion and Optimization Management Project (SHDC12023101). The method includes the following steps: Step 1: Signal Preprocessing and Search Window Definition. For sampling rates... single-channel MCG signal Preprocessing was performed using a 1Hz high-pass filter to suppress baseline drift and a 40Hz low-pass filter to attenuate high-frequency electromyographic noise. After filtering, it was assumed that the QRS complex origin of the current heartbeat was located at the sample point, as determined by an R-wave detector. Based on the location of the R wave, a "time-domain search window" is defined in each cardiac cycle where the P wave is most likely to appear. That is, the interval from 150ms to 10ms before the QRS wave.

[0024] Step Two: Select a Morlet wavelet whose shape resembles the "mound-like" morphology of the P-wave as the mother wavelet function to match the P-wave morphology. The Morlet wavelet is a complex sine wave modulated by a Gaussian function, exhibiting excellent time-frequency localization properties. This is used to transform the time-domain signal into the time-frequency domain, ensuring the best response to the P-wave morphology during the transformation. Defined as:

[0025] in, For time, The imaginary unit, The center frequency is usually taken as... To satisfy the admissibility condition. The real part of this complex wavelet has a similar oscillation pattern to that of the P-wave.

[0026] For example, setting the center frequency parameter .

[0027] Step 3: Perform Continuous Wavelet Transform (CWT) on the signal. Performing CWT maps a one-dimensional time-domain signal into a two-dimensional, complex-valued time-scale complex coefficient matrix, the magnitude of which represents the energy distribution.

[0028] Transformation process: For signals within the search window The definition of performing continuous wavelet transform is:

[0029] in, It is the input signal. It is the complex conjugate of the mother wavelet. It is the scale factor (inversely proportional to frequency). This is the time shift factor. Calculation results. It is a complex two-dimensional matrix that contains information in two dimensions: The magnitude represents the energy intensity of the signal near time point b in the corresponding frequency band at scale a.

[0030]

[0031] Phase, whose value reflects the phase information of the signal at that time-frequency point:

[0032] Step 4: Determine the characteristic scale range of the P wave. Based on the physiological frequency characteristics of the P wave, determine the "characteristic scale range" where its energy is mainly concentrated after wavelet transform. This is crucial for achieving noise suppression and signal enhancement.

[0033] Based on physiological knowledge, the energy of the P wave is mainly concentrated in the low-frequency range of 3-10Hz, meaning the target P wave physiological frequency range for analysis is:

[0034] This invention utilizes the correspondence between mother wavelet scale and frequency to transform this prior physiological knowledge into a specific characteristic scale range. Scale a and its corresponding pseudo-frequency The relationship between them is given by the following formula:

[0035] in, It is the sampling frequency of the signal. It is the center frequency of the mother wavelet. For the Morlet wavelet, its center frequency is... for:

[0036] For example:

[0037] Therefore, by considering the physiological frequency range of the P wave Substituting these values ​​into the formula above, the feature scale range used for the search can be accurately calculated. :

[0038]

[0039] For example:

[0040]

[0041] Therefore, the feature scale range is determined to be [96, 318].

[0042] Step 5: P-wave localization based on modulus maxima. Within the defined "time-domain search window". and "feature scale range" Within the constructed two-dimensional plane, the time-scale complex coefficient matrix is ​​found. The maximum value point is used to accurately locate the candidate position of the P wave.

[0043] After completing the time-frequency mapping and identifying the key analysis region, the detection of the P-wave becomes a clear localization problem.

[0044] Location process: Search window in the time dimension and the feature scale range of the scale dimension Within the two-dimensional rectangular region formed, search for the modulus of the mother wavelet coefficients. maximum point .

[0045]

[0046] The time coordinate of the maximum point This is the moment that is identified as the central peak of the P wave.

[0047] Assuming at point Get the maximum value Therefore, it is preliminarily determined that the central peak of the P wave is located at the sample point. Place.

[0048] Confirmation mechanism: the maximum coefficient value located This represents the energy intensity of the P-wave candidate point. To ensure the effectiveness of the detection, this value needs to be compared with a confirmation threshold. Traditional fixed threshold or global threshold methods have many limitations. Therefore, this invention proposes an innovative adaptive threshold confirmation method that adaptively adjusts based on local noise in the signal.

[0049] Step Six: Adaptive Threshold Confirmation Based on Local Noise Estimation. This step aims to dynamically adjust the confirmation criteria according to the local noise characteristics of each heartbeat. The local noise level within the current search window is dynamically calculated, and an adaptive confirmation threshold is generated accordingly.

[0050] Defining the local noise window: within a P-wave's "time-domain search window" Inside, for example The energy of the P-wave is mainly concentrated near its peak. Therefore, the portion of the window furthest from the P-wave peak center can be used to estimate the background noise in that frequency band. This invention chooses to define a "noise estimation window" at the beginning of the search window. For example, we can take ,in It is a relatively short noise estimation window (e.g., 30ms), which typically does not include the main part of the P-wave, i.e. .

[0051] Calculation of local noise level: within the noise estimation window (time) ∈ ), and within the "characteristic scale range" of the P wave. (scale Extract the modulus values ​​of all mother wavelet coefficients within the range [96, 318]. To robustly estimate noise levels and avoid accidental spikes, this invention uses the median absolute deviation as the noise standard deviation. Estimation quantization (i.e., calculating the standard deviation estimate of local noise):

[0052] in, In the time dimension and scale dimension The set of all wavelet coefficient moduli within the range. The denominator 0.6745 is a correction coefficient that improves the MAD estimate when the data follows a Gaussian distribution. Consistent with standard deviation.

[0053] Adaptive threshold generation and P-wave confirmation: Based on the calculated local noise level, the adaptive confirmation threshold is defined as a multiple thereof:

[0054] in, It is a preset sensitivity factor, representing the requirement that the P-wave signal strength be at least as low as noise. times.

[0055] Assumption Set sensitivity factor ,according to Calculate the adaptive confirmation threshold. .

[0056] Step 7: Finally, based on the adaptive confirmation threshold, the validity of the candidate P-wave locations is confirmed.

[0057] The final confirmation mechanism is updated as follows: the wavelet coefficient modulus maxima corresponding to the candidate P-wave peak value located in step five are... ( ) and adaptive threshold ( ) for comparison, when At that time, it was finally confirmed that... There is a valid P-wave at the location, output ,like If no reliable P wave is detected in this heartbeat, it is considered that no P wave was detected.

[0058] The core idea of ​​the magnetic P-wave detection method based on wavelet analysis and local noise adaptive threshold provided by the invention embodiments is to transform the traditional detection mode of finding the "amplitude extreme point" in the "one-dimensional time domain" into a brand-new mode of finding the "energy accumulation point" in the "two-dimensional time-frequency domain".

[0059] The basic principle is that the P wave, as a physiological signal with a specific duration and smooth morphology, necessarily concentrates its energy within a specific frequency range. Baseline drift is a lower-frequency component, while electromyographic noise is a higher-frequency component. Wavelet transform, as a powerful time-frequency analysis tool, can decompose the signal into different scales (frequency) for observation. The P wave produces a significant energy response at a specific scale, while the responses of various noises at that scale are greatly reduced.

[0060] This invention leverages this characteristic to achieve accurate and robust detection of the P wave by searching on the "feature scale" that best highlights it. To address the aforementioned challenge of threshold setting, this invention further introduces an adaptive threshold confirmation mechanism based on local noise estimation. Its core lies in moving away from a fixed or global threshold and instead dynamically evaluating the noise level within a "time-domain search window" for each cardiac cycle. By statistically analyzing the wavelet coefficients within the feature scale in the region where the P wave is least likely to occur (e.g., the end of the PR segment immediately adjacent to the R wave), an estimate accurately reflecting the local noise situation of the current heartbeat can be obtained. This invention uses this noise estimate to dynamically generate an adaptive confirmation threshold, enabling real-time and precise adaptation to the signal-to-noise ratio of each heartbeat.

[0061] The P-wave detection method based on multi-resolution wavelet analysis proposed in this invention, through its unique technical solution, directly brings the following technical effects, effectively overcoming many problems existing in the background technology: Strong resistance to baseline drift and high-frequency noise: This invention effectively separates the P wave from interference components with extremely low frequencies (baseline drift) or extremely high frequencies (electromyographic noise) in the analysis domain by analyzing within a specific "characteristic scale range." Therefore, the P wave can be stably detected in signals with severe baseline drift or high-frequency noise without the need for complex additional filtering.

[0062] High sensitivity to low signal-to-noise ratio signals: The core of this method is to detect the "concentration" of energy in the time-frequency domain, rather than the "absolute amplitude" in the time domain. A P-wave with a low amplitude but regular shape and matched frequency components can still produce a significant wavelet coefficient peak at its characteristic scale. This enables the present invention to successfully detect weak P-waves that traditional thresholding methods would miss.

[0063] Significantly improved detection accuracy and reliability: This invention's innovative adaptive threshold mechanism dynamically adjusts the decision criteria based on the local noise level of each cardiac cycle. This allows the system to automatically raise the threshold in noisy cardiac cycles to avoid false positives (false detections), while appropriately lowering the threshold in clean cardiac cycles with weak P waves to avoid false negatives (false negatives), thus maintaining high detection accuracy under various signal conditions.

[0064] Strong adaptability to signal quality variations: Traditional global thresholding cannot cope with non-stationary noise fluctuations in signals. The method of this invention can respond to and adapt to noise variations between heartbeats in real time. This "heartbeat-by-heart" adaptability ensures that detection performance remains robust even in recordings with dynamically changing signal quality.

Claims

1. A method for detecting magnetic P-waves in cardiac signals based on wavelet analysis and adaptive threshold for local noise, characterized in that: Includes the following steps: Single-channel MCG signal at target sampling rate High-pass and low-pass filtering were performed to obtain the filtered signal, which suppressed baseline drift and attenuated high-frequency electromyographic noise. The QRS wave initiation point was located at the sample point based on the filtered signal. Delineate each cardiac cycle As a time-domain search window; Based on the shape of the filtered signal, the mother wavelet is determined using the mother wavelet function, which is as follows: in, For time, The imaginary unit, The center frequency; Based on the mother wavelet for single-channel MCG signals Perform continuous wavelet transform to generate time-scale complex coefficient matrix The formula is as follows: in, It is the input signal. It is the complex conjugate of the mother wavelet. It is a scale factor inversely proportional to frequency. It is the time shift factor; Time-scale complex coefficient matrix Includes mod and phase ; Based on the physiological frequency characteristics of the P wave, the target P wave physiological frequency range for analysis is determined as follows: By utilizing the correspondence between the mother wavelet scale and frequency, the characteristic scale range can be obtained. The formula is as follows: in, It is the center frequency of the mother wavelet. It is the sampling frequency of the signal; Within the two-dimensional plane defined by the time-domain search window and the feature scale range, search for the time-scale complex coefficient matrix. Maximum point Therefore, it is preliminarily determined that the central peak of the P wave is located at Locate candidate locations for the P wave; Define a noise estimation window at the beginning of the time-domain search window. Within the noise estimation window and within the feature scale range, all moduli are extracted. The standard deviation of local noise is estimated using the median absolute deviation: in, In the time dimension and scale dimension The set of all modulo elements within; Threshold confirmation based on standard deviation estimate: in, It is a preset sensitivity factor, representing the requirement that the P-wave signal strength be at least as low as noise. ; The validity of candidate locations for P-waves is confirmed based on a confirmation threshold. At that time, it was finally confirmed that... The location has a valid P-wave and outputs it.

2. The magnetic resonance P-wave detection method based on wavelet analysis and local noise adaptive threshold as described in claim 1, characterized in that, The high-pass filter is 1Hz and the low-pass filter is 40Hz.

3. The magnetic resonance P-wave detection method based on wavelet analysis and local noise adaptive threshold as described in claim 1, characterized in that, The center frequency in the mother wavelet function .

4. The magnetic resonance P-wave detection method based on wavelet analysis and local noise adaptive threshold as described in claim 1, characterized in that, The modulus represents the energy intensity of the signal near time point b in the corresponding frequency band at scale a, and the phase reflects the phase information of the signal at that time and frequency point.

Citation Information

Cited By

  • Method for automatically searching peak of energy spectrum at given position

    CN121808349A