Adaptive enhanced Gramer-Schmidt hybrid interpolation electromyographic signal filtering method and system for non-integer sampling ratio scene
By employing an adaptive enhanced Gram-Schmidt hybrid interpolation electromyography signal filtering method, the artifact suppression problem under dynamic NSR conditions is solved, achieving highly robust and high-fidelity vEMG signal extraction, which is suitable for functional electrical stimulation systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NINGXIA UNIVERSITY
- Filing Date
- 2026-03-09
- Publication Date
- 2026-05-01
AI Technical Summary
In scenarios with dynamic non-integer sampling ratios, the traditional Gram-Schmidt algorithm suffers from artifact suppression performance degradation due to the non-integer or time-varying ratio of sampling rate to stimulation frequency. This results in the inability to effectively extract high-quality autonomous electromyographic signals, thus affecting the effectiveness of functional electrical stimulation systems.
An adaptive enhanced Gram-Schmidt hybrid interpolation method for EMG signal filtering is adopted. Through orthogonalization processing, dual-modal time-frequency anomaly detection, and context-aware mechanisms, the artifact suppression problem under dynamic NSR conditions is specifically addressed. This includes strategies such as local median filtering, cubic spline interpolation, and PCHIP interpolation to ensure signal robustness and fidelity.
It significantly improves the extraction fidelity of vEMG signals under single-channel conditions, adapts to dynamic NSR environments, provides the algorithmic basis for a highly robust adaptive closed-loop FES system, effectively suppresses artifact interference, and maintains the time-frequency characteristics of physiological signals.
Smart Images

Figure CN121958766A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of biomedical signal processing, neural engineering and rehabilitation engineering, and in particular to an adaptive enhanced Gram-Schmidt hybrid interpolation electromyographic signal filtering method and system for non-integer sampling ratio scenarios. Background Technology
[0002] Injuries involving the central nervous system, such as stroke or spinal cord injury, often lead to severe motor dysfunction. Functional electrical stimulation (FES), which induces muscle contraction through electrical impulses, has become an important neurorehabilitation method. Studies have shown that combining FES with the patient's voluntary motor intention (i.e., the "active rehabilitation" paradigm) can more effectively promote neuroplasticity and achieve more lasting rehabilitation results. Voluntary surface electromyography (vEMG) signals directly reflect cortical motor commands and are an ideal control source for realizing a closed-loop FES system based on real-time feedback of motor intention.
[0003] However, applying FES during vEMG acquisition introduces two serious types of interference: first, broadband, high-amplitude stimulus artifacts generated by the stimulation current coupled to the recording amplifier; and second, muscle action potentials (M-waves) directly induced by FES. The amplitude of the stimulus artifacts can be tens of times that of the vEMG, and the M-waves and vEMGs overlap significantly in the time and frequency domains. This renders traditional filtering methods (such as fixed bandpass filtering) ineffective.
[0004] Existing vEMG extraction techniques mainly include the blank window method, signal decomposition method, adaptive filtering, and template subtraction method (such as methods based on Gram-Schmidt orthogonalization). Among them, Gram-Schmidt (GS) methods have attracted attention due to their clear principles and good performance under integer sampling ratio conditions. However, real-world clinical rehabilitation and closed-loop FES systems often require dynamic adjustment of stimulation parameters (e.g., continuous or discrete frequency variations within the 20-50Hz range) under different muscle states and tasks. This results in a non-integer ratio (NSR) for the sampling rate to the stimulation frequency. The NSR condition violates the periodic synchronization assumption of signal processing, leading to problems such as phase drift, boundary truncation, and template mismatch, resulting in severe performance degradation of traditional GS algorithms and other periodic-dependent methods.
[0005] While existing research has improved the robustness of GS algorithms to parameter jumps by introducing multi-channel information or dynamic mechanisms, these improvements typically target discrete parameter variations and fail to systematically address the core challenge of time-varying temporal nonstationarity caused by continuous frequency modulation or dynamic NSR. Therefore, there is an urgent need for a vEMG extraction algorithm specifically designed to handle dynamic NSR environments while maintaining high robustness and signal fidelity under single-channel conditions. Summary of the Invention
[0006] In view of this, the present invention provides an adaptive enhanced Gram-Schmidt hybrid interpolation electromyography signal filtering method and system for scenarios with non-integer sampling ratios. It aims to solve the performance degradation problem of traditional artifact suppression algorithms caused by non-integer or time-varying ratios of stimulation frequency to sampling rate in dynamic FES environments, and to provide reliable and high-quality autogenous electromyography signals for closed-loop FES systems.
[0007] The technical solution adopted by the embodiments of the present invention to solve its technical problem is as follows:
[0008] The first aspect of this invention provides an adaptive enhanced Gramm-Schmidt hybrid interpolation electromyography signal filtering method for scenarios with non-integer sampling ratios, comprising:
[0009] Step S1: Orthogonalize the preprocessed electromyographic signal containing stimulation artifacts to output the initial inhibition signal after initial inhibition artifacts and M-wave energy.
[0010] Step S2: A dual-modal time-frequency anomaly detection strategy is used to identify residual artifacts in the pre-processed signal, and continuous anomaly intervals are located based on the residual artifacts. The dual-modal time-frequency anomaly detection strategy includes: filtering out signal amplitude anomalies based on the time domain signal, and performing secondary filtering based on the energy concentration of the frequency domain signal to obtain residual artifacts.
[0011] Step S3: Adaptively repair continuous abnormal intervals based on a context-aware mechanism:
[0012] If there are clean samples within a continuous abnormal interval, local median filtering is used to repair the continuous abnormal interval.
[0013] If there are no clean samples inside the continuous abnormal interval, determine whether the continuous abnormal interval has a continuous clean reference segment with a length not less than the dynamic minimum on both sides.
[0014] When the judgment result is that there are continuous clean reference segments with a length not less than the dynamic minimum on both sides of the continuous abnormal interval, cubic spline interpolation is used to repair the continuous abnormal interval.
[0015] If the judgment result is that there are continuous clean reference segments with a length not less than the dynamic minimum on both sides of the continuous abnormal interval, it is further judged whether there are samples in any continuous clean reference segment.
[0016] If a sample exists within any consecutive clean reference segment, then PCHIP interpolation repairs the consecutive abnormal intervals.
[0017] If no sample exists within any consecutive clean reference segment, local median filtering is used to repair the consecutive abnormal intervals.
[0018] The starting and ending neighborhoods of the interval after difference repair are post-processed using a short window mid-range filter to obtain the final artifact-free vEMG signal.
[0019] Preferably, the preprocessing in step S1 includes:
[0020] All raw vEMG signals are first passed through a second-order Butterworth bandpass filter (20–200 Hz) to suppress baseline drift and high-frequency noise. Zeros are then padded to the end of the signal based on the length of the original filtered signal and the required segment length to obtain the filtered signal. .
[0021] Preferably, step S1 includes:
[0022] Preprocessed signal Divided into Segments, each segment is [length missing] N represents the length of the preprocessed signal;
[0023] In the current segment Internally, backtrack to retrieve the most recent... A series of consecutive stimulus period frames constitute the historical reference set. , where the frame length is , For stimulation frequency, Sampling rate; The closest frame to the current frame to be processed. express The oldest frame;
[0024] based on Perform the Gram-Schmidt orthogonalization process:
[0025] initialization: = , ;
[0026] Iteration arrive :
[0027] Perform M-order Gram-Schmidt orthogonalization with Tikhonov regularization:
[0028] ;
[0029] ;
[0030] in, It is the first The stimulation period frame in the ... The residual vector in the orthogonalization iteration; It is the projected weight. As a regularization factor;
[0031] Output: After M orthogonalizations, the final residual of the current frame to be processed is taken as the preliminary artifact suppression result of the current frame to be processed. The suppression results of all frames constitute a complete preliminary suppression signal in chronological order.
[0032] All segments The data is assembled in chronological order to form a preliminary suppression signal. .
[0033] Preferably, step S2 includes:
[0034] Step S21, for Time-domain coarse filtering: using an adaptive window Hampel identifier Based on local median Preliminary screening based on the median absolute deviation (MAD) to select those that meet the criteria The points are candidate anomalies, among which, ;
[0035] Step S22, for each candidate outlier Perform detailed frequency domain verification:
[0036] Extract to Centered on, with a length of The neighborhood signal, ;
[0037] A 4-term Nuttall window is applied to the neighborhood signal, followed by a zero-filled short-time Fourier transform (STFT) to obtain an FFT with a length of [missing value]. The signal;
[0038] like The stimulation frequency band energy ratio Above the adaptive threshold Then confirm For residual stimulus artifacts, where:
[0039] ;
[0040] ;
[0041] In the formula, At any moment The STFT coefficients of the nearby signal, with The local signal centered on the first Complex spectral amplitude at each frequency bin The time index for candidate anomalies; Indexed by frequency bin; Includes from Hz to The bin represents all frequencies in Hz; the denominator is the total energy over the entire positive frequency range [0, Nyquist]. It is the background noise power estimated from the subject's resting period; It is a natural exponential function;
[0042] Step S23, the interval does not exceed Candidate outliers are merged into continuous outlier intervals to obtain at least one continuous outlier interval.
[0043] Preferably, step S3 includes:
[0044] Step S31, for each abnormal interval Calculate the length of the continuous clean reference segment on both sides of the interval. , ,in Indicates from Count to the left, up to the number of consecutive clean samples until the previous artifact or boundary is encountered. Indicates from Count to the right the number of consecutive clean samples until the next artifact or boundary is encountered;
[0045] Step S32, repair the continuous abnormal intervals:
[0046] Step S321: Check if there are any unmarked samples within the interval, i.e., whether the condition is met. ;
[0047] Step S322, if the judgment result is satisfied Then, a 5-point median filter is used to repair continuous abnormal intervals. and neighboring areas ;
[0048] Step S323, if the judgment result is not satisfied Then further determine whether it satisfies and ;in, Indicates the dynamic minimum value. The signal's dominant frequency is estimated from the resting segment data using the Welch method.
[0049] Step S324, if the judgment result is satisfied and Then the lengths of the left and right sides are respectively and Using the clean reference segment as the boundary condition, cubic spline interpolation is employed to repair continuous anomaly intervals. ;
[0050] Step S325, if the judgment result is not satisfied and Then further determine whether it satisfies or ;
[0051] Step S326, if satisfied or And there are no clean samples within the interval, i.e. Then, the PCHIP interpolation method is used to repair continuous abnormal intervals. ;
[0052] Step S327, if not satisfied or Then, a 5-point median filter is used to repair continuous abnormal intervals. and neighboring areas ;
[0053] Step S328, the repaired interval Relabel as a clean sample;
[0054] Step S33, Post-repair processing: For the intervals that have been repaired by interpolation (i.e., repaired using strategy ④ or ⑥ in step S32) The starting neighborhood [max(0, n_s-2), min(N-1, n_s+2)] and ending neighborhood [max(0, n_e-2), min(N-1, n_e+2)] are each subjected to 5-point median filtering smoothing to ensure seamless connection between the repaired segment and the original signal; all original samples not marked as artifacts remain unchanged throughout the process, resulting in the final artifact-free vEMG signal. .
[0055] A second aspect of the present invention provides an adaptive enhanced Gramm-Schmidt hybrid interpolation electromyography signal filtering system for non-integer sampling ratio scenarios, comprising a suppression module, a detection module, and a repair module connected in sequence:
[0056] The inhibition module is used to orthogonalize the preprocessed electromyographic signal containing stimulation artifacts and output the initial inhibition signal after initial inhibition artifacts and M-wave energy.
[0057] The detection module is used to identify residual artifacts in the pre-processed signal using a dual-modal time-frequency anomaly detection strategy, and to locate continuous anomaly intervals based on the residual artifacts. The dual-modal time-frequency anomaly detection strategy includes: filtering out signal amplitude anomalies based on the time domain signal, and performing secondary filtering based on the energy concentration of the frequency domain signal to obtain residual artifacts.
[0058] The repair module is used to adaptively repair continuous abnormal intervals based on a context-aware mechanism.
[0059] If there are clean samples within a continuous abnormal interval, local median filtering is used to repair the continuous abnormal interval.
[0060] If there are no clean samples inside the continuous abnormal interval, determine whether the continuous abnormal interval has a continuous clean reference segment with a length not less than the dynamic minimum on both sides.
[0061] When the judgment result is that there are continuous clean reference segments with a length not less than the dynamic minimum on both sides of the continuous abnormal interval, cubic spline interpolation is used to repair the continuous abnormal interval.
[0062] If the judgment result is that there are continuous clean reference segments with a length not less than the dynamic minimum on both sides of the continuous abnormal interval, it is further judged whether there are samples in any continuous clean reference segment.
[0063] If a sample exists within any consecutive clean reference segment, then PCHIP interpolation repairs the consecutive abnormal intervals.
[0064] If no sample exists within any consecutive clean reference segment, local median filtering is used to repair the consecutive abnormal intervals.
[0065] The starting and ending neighborhoods of the interval after difference repair are post-processed using a short window mid-range filter to obtain the final artifact-free vEMG signal.
[0066] As can be seen from the above technical solution, the adaptive enhanced Gram-Schmidt hybrid interpolation electromyography signal filtering method and system for non-integer sampling ratio scenarios provided by the embodiments of the present invention first orthogonally processes the preprocessed electromyography signal containing stimulation artifacts, outputting a preliminary suppressed signal after initial artifact suppression and M-wave energy; a dual-modal time-frequency anomaly detection strategy is used to identify residual artifact points in the preliminary processed signal, and continuous abnormal intervals are located based on the residual artifact points; the dual-modal time-frequency anomaly detection strategy includes: filtering signal amplitude anomalies based on the time domain signal, performing secondary filtering based on the energy concentration of the frequency domain signal to obtain residual artifact points; and adaptively repairing continuous abnormal intervals based on a context-aware mechanism to obtain the final artifact-free vEMG signal. The beneficial effects of the present invention are: it specifically solves the dynamic NSR challenge, and through regularized GS, dual-modal detection and context-aware interpolation, it achieves high robustness to time-varying stimulation parameters under single-channel conditions, significantly improves the fidelity of vEMG extraction, and lays the algorithmic foundation for the adaptive closed-loop FES system. Attached Figure Description
[0067] 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.
[0068] Figure 1 This is a flowchart of the adaptive interpolation repair decision logic of the present invention.
[0069] Figure 2 A flowchart is provided to construct a synthetic mixed signal for four FES scenarios by superimposing a clean vEMG signal with an electrical stimulation artifact in the time domain.
[0070] Figure 3 This chart presents a performance comparison of the original vEMG, mixed signal, AEGS-HI, and three other algorithms in four FES scenarios based on MAV and NSS metrics.
[0071] Figure 4 The graph shows the power spectral density (PSD) performance comparison data between AEGS-HI and other methods in four FES scenarios.
[0072] Figure 5 A schematic diagram comparing the time-domain and time-frequency characteristics of the synthesized mixed signal before and after AEGS-HI processing.
[0073] Figure 6 A schematic diagram comparing the time-domain and time-frequency characteristics of the in-situ mixed signal before and after AEGS-HI processing.
[0074] Figure 7 A schematic diagram comparing the power spectral density (PSD) of the signal before and after AEGS-HI processing with that of the reference vEMG. Detailed Implementation
[0075] To make the objectives, technical solutions, and advantages of this invention clearer, the application of this invention in extracting voluntary electromyography (vEMG) signals under dynamic functional electrical stimulation (FES) conditions will be described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment aims to demonstrate the implementation steps of the AEGS-HI algorithm and verify its effectiveness through systematic experimental design and quantitative evaluation.
[0076] This invention provides a filtering method and system for high-fidelity extraction of autonomous electromyography (vEMG) signals from strong stimulus artifacts and evoked electromyography (M-wave) interference in a functional electrical stimulation (FES) environment, particularly in dynamic scenarios with non-integer sampling ratios (NSR). The filtering method addresses the performance degradation problem of traditional artifact suppression algorithms in dynamic FES environments due to the non-integer ratio of stimulation frequency to sampling rate by proposing a three-stage processing framework: First, a sixth-order Gram-Schmidt (GS) algorithm with Tikhonov regularization is used to robustly remove primary artifacts from the preprocessed VEMG signals. M-wave suppression is used to obtain a preliminary processed signal. Next, dual-modal time-frequency anomaly detection is applied to the preliminary processed signal. This is combined with temporal coarse screening using an adaptive window Hampel marker and harmonic energy ratio analysis based on short-time Fourier transform to accurately locate residual artifacts or over-suppressed regions. Finally, a context-aware adaptive interpolation mechanism is used to repair the identified abnormal intervals. This mechanism employs hierarchical decision-making based on the presence of clean samples within the abnormal interval and whether the length of consecutive clean reference segments on both sides meets the minimum requirement. It uses cubic spline interpolation, PCHIP interpolation, or local median filtering strategies for repair, and performs post-processing smoothing on the interpolation boundaries. This invention effectively solves the timing mismatch problem caused by dynamic NSR under single-channel conditions, providing a high-fidelity autonomous electromyography signal extraction scheme for closed-loop FES systems.
[0077] Example: vEMG extraction and verification of the AEGS-HI algorithm in a dynamic FES environment.
[0078] This embodiment includes four main stages: signal acquisition, data construction, algorithm processing, and performance evaluation. The experimental procedure is as follows: Figure 2 As shown.
[0079] 1. Signal Acquisition and Data Source Construction:
[0080] To ensure the accuracy of the evaluation, a clean reference signal is first obtained through a signal source separation protocol.
[0081] Participants and Equipment: Eight healthy participants were involved in the experiment. A constant current stimulator (Shanghai Nuocheng Electric) was used to apply free electromyography (FES) to the extensor carpi ulnaris muscle, using a biphasic trapezoidal pulse (pulse width 200 µs). Surface electromyography (sEMG) was recorded using a Trigno™ wireless electromyography system (Delsys Inc., USA) at a sampling rate of 2000 Hz.
[0082] Stimulation parameter library: A comprehensive stimulus artifact template library was constructed. Stimulation frequencies ranged from 20 Hz to 50 Hz, increasing in 5 Hz increments; current intensities were set to the motion threshold (8 mA) and higher tolerance levels (14 mA).
[0083] 2. Construction of synthetic datasets (progressive stress testing)
[0084] To systematically evaluate the performance boundaries of the algorithm in scenarios ranging from steady state to highly dynamic environments, the aforementioned clean signals were linearly superimposed in a 1:1 time domain to construct four synthetic scenarios with increasing complexity (see [link to relevant documentation]). Figure 2 Build process):
[0085] Scenario 1 (Intermittent fixed-frequency stimulation): Simulates periodic treatment, with the signal alternating between a 2-second mixed segment (vEMG + fixed-frequency FES) and a 2-second pure vEMG segment.
[0086] Scenario 2 (Continuous Single-Frequency Stimulation): Provides a steady-state environment without start-stop transients, where a single-frequency FES and vEMG coexist continuously.
[0087] Scenario 3 (Stepped Frequency Stimulation): The stimulation frequency increases from 20 Hz to 50 Hz in 5 Hz steps, with 2000 sampling points per frequency plateau, aiming to test the algorithm's adaptability to step changes in parameters and cumulative phase drift.
[0088] Scenario 4 (Intermittent Frequency Variable Stimulation): The most challenging dynamic scenario. During each 2-second stimulation period, a frequency is randomly selected from {20, 25, ..., 50} Hz to simulate continuous parameter adjustment based on real-time feedback in a closed-loop FES system.
[0089] 3. Application and processing of the AEGS-HI algorithm:
[0090] The AEGS-HI algorithm was applied to the aforementioned synthetic dataset and in-situ mixed signals. The specific processing steps are as follows, and the overall flow is as follows: Figure 1 As shown:
[0091] Preprocessing: All raw vEMG signals are first passed through a second-order Butterworth bandpass filter (20–200 Hz) to suppress baseline drift and high-frequency noise. The signals are then padded with zeros at the end to ensure a fixed segment length. ( Integer multiples of ), i.e. ,in , This represents the length of the original signal after filtering. This ensures that subsequent segmentation is free of boundary truncation artifacts.
[0092] S1: Robust suppression phase: The preprocessed signal... conduct Segmentation Each segment is [length] ,common Section, record the first Duan Wei .
[0093] Frame definition: given stimulus frequency and sampling rate The number of samples (i.e., frame length) corresponding to one stimulus period is defined as:
[0094] (1)
[0095] For the current segment Backtracking (within the current segment, extracting the most recent M+1 consecutive stimulus period frames from the historical signal) to extract the most recent A complete, non-overlapping stimulus cycle frame constitutes the historical reference set:
[0096] (2)
[0097] in This indicates that the number of historical reference frames has been reduced by one, meaning there are a total of frame; It is the latest (closest to the current processing position) frame, and does not include data after the current frame to be processed; It is the oldest of these 7 frames; all 7 frames are from the current segment. Internal (because its length is) Usually much larger This is not a cross-section reference; "It does not include the current frame to be output, but rather the set of historical frames used to construct the orthogonal basis, where..." This will be the final output object to be purified.
[0098] Gram-Schmidt orthogonalization process:
[0099] initialization: = ,right .
[0100] Iteration arrive (There are a total of 6 iterations, hence the name "sixth order"):
[0101] The implementation introduces Tikhonov regularization ( The 6th-order Gram-Schmidt orthogonalization (weights calculated as shown in Equation 3) outputs a signal that initially suppresses most artifacts and M-wave energy. .
[0102] (3)
[0103] (4)
[0104] in, It is the first The stimulation period frame in the ... The residual vector in the orthogonalization iteration; It is the projected weight. This is a regularization factor used to ensure numerical stability when historical frames are nearly collinear. Output: The final residual of the latest frame after 6 orthogonalization iterations. This serves as the initial artifact suppression result for this segment. All segments The data is assembled in chronological order to form a preliminary suppression signal. This step involves a 6th-order Gram-Schmidt orthogonalization process, projecting the current frame onto the subspace spanned by historical frames and subtracting the projected components. The key innovation lies in introducing a Tikhonov regularization term into the projection weight calculation. (e.g. 10⁻) 6 This effectively solves the numerical instability problem caused by the near collinearity of historical frames due to boundary truncation under NSR conditions, and outputs a signal that initially suppresses most of the periodic energy.
[0105] S2: Precision detection stage: Perform dual-modal detection on the pre-processed signal to distinguish residual artifacts from physiological activity.
[0106] S21, for Temporal coarse screening: An adaptive window Hampel identifier is used (window length W is based on local stimulus frequency). and sampling rate (Dynamically adjusted)
[0107] (5)
[0108] Based on the local median and median absolute deviation (MAD), outliers are initially screened as candidate points; if the following conditions are met:
[0109] (6)
[0110] but These are candidate outliers. It is the local median, which is the median of all samples within the window.
[0111] (7)
[0112] MAD is calculated based on the data within the current window and reflects the degree of local dispersion. Multiplying it by 1.4826 makes MAD an unbiased estimate of the standard deviation under Gaussian noise.
[0113] S22, for each candidate point Perform fine-grained frequency domain validation: extract the following: Centered on, with a length of The neighborhood signal, where:
[0114] (8)
[0115] It covers approximately 3 stimulation cycles.
[0116] A 4-term Nuttall window is applied to the neighborhood signal, followed by a zero-fill STFT. The FFT length is [value missing]. .
[0117] Define the stimulus band energy ratio:
[0118] (9)
[0119] At any moment The STFT coefficients of the nearby signal, with The local signal centered on the first Complex spectral amplitude at each frequency bin The time index for candidate anomalies; Indexed by frequency bin; Includes from Hz to The Hz represents all frequency bins (covering the fundamental frequency to the 7th harmonic, with a ±2Hz tolerance to accommodate clinical FES frequency jitter); the denominator is the total energy over the entire positive frequency range (0 to Nyquist).
[0120] Adaptive threshold:
[0121] (10)
[0122] in It is the background noise power estimated from the subject's resting period (without stimulation); It is the natural exponential function ( (power of) ; threshold It decreases as noise power increases, reflecting the adaptive concept of "tolerating higher artifact energy in high-noise environments"; Judgment rule: if Then confirm This design addresses residual stimulus artifacts. It maintains high sensitivity in low noise conditions and prevents false positives in high noise conditions.
[0123] S23 merges adjacent (interval) Isolated artifacts (i.e., ≤20% of stimulation cycles) are considered continuous abnormal intervals. .
[0124] S3: Adaptive Repair Phase
[0125] S31 for each abnormal interval Repair is performed based on a context-aware adaptive interpolation mechanism, and its decision logic flow is shown in Appendix S1 (adaptive interpolation repair decision logic flow diagram).
[0126] First, calculate the length of the continuous clean reference segments on both sides of the interval. (from Count to the left until you encounter another artifact or boundary) and (from Counting to the right), check if there are any samples within the interval that are not marked as artifacts (i.e., );
[0127] Set minimum reference length:
[0128] (11)
[0129] in The signal frequency is estimated using the Welch method during the resting phase.
[0130] S32, It is fake, and and At that time, strategy 1 (cubic spline interpolation) is adopted, using sufficiently long clean segments on both the left and right sides for smooth interpolation;
[0131] It is false, and at least one side has a reference sample ( or When using strategy 2 (PCHIP interpolation), it is suitable for scenarios with a reference on one side and where shape monotonicity needs to be preserved.
[0132] All other cases, including: (There are clean points within the interval that cannot be covered); there are no reference samples on either side (e.g., at the start / end of the signal); for the interval and its neighborhood Apply strategy 3 (5-point median filtering); Note: This operation will slightly modify the originally clean samples within the interval, but because the window is small and it is only used when necessary, the impact is controllable.
[0133] Post-processing: For the intervals repaired by interpolation using strategy 1 or 2, at their starting point... peace A 5-point median filter is applied to each index neighborhood for median filtering and smoothing. Starting neighborhood: End of Neighborhood: Objective: To eliminate boundary jumps introduced by interpolation and improve continuity; all original samples not marked as artifacts remain unchanged throughout the process to ensure physiological authenticity.
[0134] Output: The final artifact-free vEMG signal is obtained. .
[0135] Among them, strategy 1 (cubic spline interpolation) can achieve the smoothest reconstruction; strategy 2 (PCHIP interpolation) can maintain local monotonicity and avoid non-physical overshoot when the reference data is limited; strategy 3 (local median filtering) can effectively suppress sharp residual artifacts, while having little impact on possible physiological signals within the interval, thus prioritizing integrity.
[0136] 4. Performance Evaluation and Result Analysis:
[0137] To comprehensively evaluate algorithm performance, multi-dimensional quantitative metrics are used (definitions are given in Supplementary Material S1):
[0138] Signal fidelity: signal-to-noise ratio (SNR, Equation 12), normalized root mean square error (NRMSE, Equation 13), root mean square correlation coefficient (RMScc, Equation 14).
[0139] (12)
[0140] (13)
[0141] (14)
[0142] Timing consistency: coefficient of determination ( Equation 15) uses the Spearman rank correlation coefficient in non-stationary scenarios.
[0143] (15)
[0144] Physiological characteristics are maintained: mean absolute value (MAV, Equation 16), number of slope sign changes (NSS), and power spectral density (PSD).
[0145] (16)
[0146] Evaluation results:
[0147] The AEGS-HI method was compared with three baseline methods (GS(6), GSG(6), and RLS) in the four synthesis scenarios mentioned above. Key performance data are summarized in Table 1.
[0148]
[0149] Table 1
[0150] Temporal and physiological characteristic analysis: such as Figure 3 As shown ( Figure 3In the diagram, (a1–d1) represents the MAV time series; (a2–d2) represents the NSS box plot. The MAV curve of the signal processed by AEGS-HI can effectively recover the muscle activation envelope in different scenarios. In the most challenging scenario 4, its NSS features are not significantly different from those of pure vEMG (p>0.05), and are significantly better than the outputs of other algorithms and mixed signals, indicating its excellent ability to preserve physiological features.
[0151] Frequency domain fidelity analysis: such as Figure 4 As shown in ((a)–(d) corresponding to scenarios 1 to 4 respectively), the PSD of the signal processed by AEGS-HI in the main physiological frequency band of 20-100Hz is highly consistent with that of pure vEMG, successfully suppressing stimulation harmonic interference, and without introducing significant distortion or excessive smoothing.
[0152] Time-frequency analysis: such as Figure 5 As shown in ((a) represents the original signal; (b) represents the processed signal), AEGS-HI effectively eliminates the vertical stripe interference caused by the stimulation pulse in the time-frequency diagram, restoring a continuous and natural time-frequency energy distribution within the physiological frequency band.
[0153] In-situ mixed signal verification: such as Figure 6 As shown in ((a) represents the original signal; (b) represents the processed signal), applying AEGS-HI to real physiological mixed signals can effectively suppress high-amplitude artifacts, and the time-domain envelope, time-frequency characteristics, and power spectrum of the output signal are shown. Figure 7 All results were consistent with the expected autonomous activation mode and the pure vEMG reference, thus completing the validity demonstration from synthetic data to the real physiological environment.
[0154] Compared with cutting-edge methods: As shown in Table 2, in comparison with representative methods in recent years, AEGS-HI achieved competitive performance indicators (RMScc: 0.66–0.93) under more stringent and clinically realistic conditions that include complete M waves and non-integer sampling ratios, highlighting its practical value in solving dynamic NSR problems.
[0155] Table 2. Performance Comparison with Advanced Artifact Removal Algorithms
[0156] Note: Most comparison algorithms were evaluated on simplified datasets (e.g., without M-waves or using simulated data). AEGS-HI achieved comparable performance under more realistic and challenging recording conditions.
[0157] This embodiment, through systematic experimental design, rigorous evaluation framework, and detailed quantitative results, fully demonstrates that the proposed AEGS-HI algorithm can effectively solve the problems of stimulus artifacts and M-wave suppression under dynamic non-integer sampling ratio (NSR) conditions. The algorithm exhibits excellent robustness, signal fidelity, and physiological feature preservation capabilities in various FES scenarios ranging from steady state to highly dynamic environments, showing significant advantages, particularly in dynamic scenarios where traditional methods fail or suffer severe performance degradation. This provides a crucial algorithmic solution for constructing an adaptive closed-loop FES system based on single-channel vEMG feedback.
[0158] The above-disclosed embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of the invention. Those skilled in the art will understand that implementing all or part of the above-described embodiments and making equivalent changes in accordance with the claims of the present invention are still within the scope of the invention.
Claims
1. An adaptive enhanced Gramm-Schmidt hybrid interpolation electromyography signal filtering method for scenarios with non-integer sampling ratios, characterized in that, include: Step S1: Orthogonalize the preprocessed electromyographic signal containing stimulation artifacts to output the initial inhibition signal after initial inhibition artifacts and M-wave energy. Step S2: A dual-modal time-frequency anomaly detection strategy is used to identify residual artifacts in the preliminary processed signal, and continuous anomaly intervals are located based on the residual artifacts. The dual-modal time-frequency anomaly detection strategy includes: filtering out signal amplitude anomalies based on the time-domain signal, and performing secondary filtering based on the energy concentration of the frequency-domain signal to obtain residual artifacts. Step S3: Adaptively repair continuous abnormal intervals based on a context-aware mechanism: If there are clean samples within a continuous abnormal interval, local median filtering is used to repair the continuous abnormal interval. If there are no clean samples inside the continuous abnormal interval, determine whether the continuous abnormal interval has a continuous clean reference segment with a length not less than the dynamic minimum on both sides. When the judgment result is that there are continuous clean reference segments with a length not less than the dynamic minimum on both sides of the continuous abnormal interval, cubic spline interpolation is used to repair the continuous abnormal interval. If the judgment result is that there are continuous clean reference segments with a length not less than the dynamic minimum on both sides of the continuous abnormal interval, it is further judged whether there are samples in any continuous clean reference segment. If a sample exists within any consecutive clean reference segment, then PCHIP interpolation repairs the consecutive abnormal intervals. If no sample exists within any consecutive clean reference segment, local median filtering is used to repair the consecutive abnormal intervals. The starting and ending neighborhoods of the interval after difference repair are post-processed using a short window mid-range filter to obtain the final artifact-free vEMG signal.
2. The adaptive enhanced Gramm-Schmidt hybrid interpolation electromyography signal filtering method for non-integer sampling ratio scenarios as described in claim 1, characterized in that, The preprocessing in step S1 includes: All raw vEMG signals are first passed through a second-order Butterworth bandpass filter (20–200 Hz) to suppress baseline drift and high-frequency noise. Zeros are then padded to the end of the signal based on the length of the original filtered signal and the required segment length to obtain the filtered signal. .
3. The adaptive enhanced Gramm-Schmidt hybrid interpolation electromyography signal filtering method for non-integer sampling ratio scenarios as described in claim 2, characterized in that, Step S1 includes: Preprocessed signal Divided into Segments, each segment is [length missing] N represents the length of the preprocessed signal; In the current segment Internally, backtrack to retrieve the most recent... A series of consecutive stimulus period frames constitute the historical reference set. , where the frame length is , For stimulation frequency, Sampling rate; The closest frame to the current frame to be processed. express The oldest frame; based on Perform the Gram-Schmidt orthogonalization process: initialization: = , ; Iteration arrive : Perform M-order Gram-Schmidt orthogonalization with Tikhonov regularization: ; ; in, It is the first The stimulation period frame in the ... The residual vector in the orthogonalization iteration; It is the projected weight. As a regularization factor; Output: After M orthogonalizations, the final residual of the current frame to be processed is taken as the preliminary artifact suppression result of the current frame to be processed. The suppression results of all frames constitute a complete preliminary suppression signal in chronological order. All segments The data is assembled in chronological order to form a preliminary suppression signal. .
4. The adaptive enhanced Gramm-Schmidt hybrid interpolation electromyography signal filtering method for non-integer sampling ratio scenarios as described in claim 3, characterized in that, Step S2 includes: Step S21, for Time-domain coarse filtering: using an adaptive window Hampel identifier Based on local median Preliminary screening based on the median absolute deviation (MAD) to select those that meet the criteria The points are candidate anomalies, among which, ; Step S22, for each candidate outlier Perform detailed frequency domain verification: Extract to Centered on, with a length of The neighborhood signal, ; A 4-term Nuttall window is applied to the neighborhood signal, followed by a zero-filled short-time Fourier transform (STFT) to obtain an FFT with a length of [missing value]. The signal; like The stimulation frequency band energy ratio Above the adaptive threshold Then confirm For residual stimulus artifacts, where: ; ; In the formula, At any moment The STFT coefficients of the nearby signal, with The local signal centered on the first Complex spectral amplitude at each frequency bin The time index for candidate anomalies; Indexed by frequency bin; Includes from Hz to The bin represents all frequencies in Hz; the denominator is the total energy over the entire positive frequency range [0, Nyquist]. It is the background noise power estimated from the subject's resting period; It is a natural exponential function; Step S23, the interval does not exceed Candidate outliers are merged into continuous outlier intervals to obtain at least one continuous outlier interval.
5. The adaptive enhanced Gramm-Schmidt hybrid interpolation electromyography signal filtering method for non-integer sampling ratio scenarios as described in claim 4, characterized in that, Step S3 includes: Step S31, for each abnormal interval Calculate the length of the continuous clean reference segment on both sides of the interval. , ,in Indicates from Count to the left, up to the number of consecutive clean samples until the previous artifact or boundary is encountered. Indicates from Count to the right the number of consecutive clean samples until the next artifact or boundary is encountered; Step S32, repair the continuous abnormal intervals: Step S321: Check if there are any unmarked samples within the interval, i.e., whether the condition is met. ; Step S322, if the judgment result is satisfied Then, a 5-point median filter is used to repair continuous abnormal intervals. and neighboring areas ; Step S323, if the judgment result is not satisfied Then further determine whether it satisfies and ;in, Indicates the dynamic minimum value. The signal's dominant frequency is estimated from the resting segment data using the Welch method. Step S324, if the judgment result is satisfied and Then the lengths of the left and right sides are respectively and Using the clean reference segment as the boundary condition, cubic spline interpolation is employed to repair continuous anomaly intervals. ; Step S325, if the judgment result is not satisfied and Then further determine whether it satisfies or ; Step S326, if satisfied or And there are no clean samples within the interval, i.e. Then, the PCHIP interpolation method is used to repair continuous abnormal intervals. ; Step S327, if not satisfied or Then, a 5-point median filter is used to repair continuous abnormal intervals. and neighboring areas ; Step S328, the repaired interval Relabel as a clean sample; Step S33, Post-repair processing: For the intervals that have been repaired by interpolation (i.e., repaired using strategy ④ or ⑥ in step S32) The starting neighborhood [max(0, n_s-2), min(N-1, n_s+2)] and ending neighborhood [max(0, n_e-2), min(N-1, n_e+2)] are each subjected to 5-point median filtering smoothing to ensure seamless connection between the repaired segment and the original signal; all original samples not marked as artifacts remain unchanged throughout the process, resulting in the final artifact-free vEMG signal. .
6. An adaptive enhanced Gram-Schmidt hybrid interpolation electromyography signal filtering system for scenarios with non-integer sampling ratios, characterized in that, For implementing the method according to any one of claims 1-5, the system comprises an inhibition module, a detection module, and a repair module connected in sequence: The inhibition module is used to orthogonalize the preprocessed electromyographic signal containing stimulation artifacts and output the initial inhibition signal after initial inhibition artifacts and M-wave energy. The detection module is used to identify residual artifacts in the preliminary processed signal using a dual-modal time-frequency anomaly detection strategy, and to locate continuous anomaly intervals based on the residual artifacts. The dual-modal time-frequency anomaly detection strategy includes: filtering out signal amplitude anomalies based on the time-domain signal, and performing secondary filtering based on the energy concentration of the frequency-domain signal to obtain residual artifacts. The repair module is used to adaptively repair continuous abnormal intervals based on a context-aware mechanism. If there are clean samples within a continuous abnormal interval, local median filtering is used to repair the continuous abnormal interval. If there are no clean samples inside the continuous abnormal interval, determine whether the continuous abnormal interval has a continuous clean reference segment with a length not less than the dynamic minimum on both sides. When the judgment result is that there are continuous clean reference segments with a length not less than the dynamic minimum on both sides of the continuous abnormal interval, cubic spline interpolation is used to repair the continuous abnormal interval. If the judgment result is that there are continuous clean reference segments with a length not less than the dynamic minimum on both sides of the continuous abnormal interval, it is further judged whether there are samples in any continuous clean reference segment. If a sample exists within any consecutive clean reference segment, then PCHIP interpolation repairs the consecutive abnormal intervals. If no sample exists within any consecutive clean reference segment, local median filtering is used to repair the consecutive abnormal intervals. The starting and ending neighborhoods of the interval after difference repair are post-processed using a short window mid-range filter to obtain the final artifact-free vEMG signal.