An electromyographic signal decomposition method and system based on waveform intelligent clustering

CN122388604BActive Publication Date: 2026-09-18YUNCHEN (ZHEJIANG) MEDICAL TECH CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610874364.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-17
Publication Date
2026-09-18
Estimated Expiration
2046-06-17

AI Technical Summary

Technical Problem

[0003]当前传统肌电分析仅依靠宏观统计特征与人工主观判断,无法还原肌电活动细节,分析结果粗糙、难以量化,且客观性与可重复性不足,无法满足精准评估需求

Benefits of technology

本申请提出了一种基于波形智能聚类的肌电信号分解方法及系统,通过原始肌电信号分段与有效叠加片段筛选、波形特征提取与智能聚类、典型波形模板生成、叠加片段约束优化分解、运动单位发放序列构建、发放时序缺失补偿与伪迹剔除等步骤,实现了复杂叠加肌电信号下运动单位放电波形的精准分离与发放时序的完整重构。首先,对原始肌电信号进行分段截取,筛选出存在多运动单位叠加的有效片段;再基于波形特征进行聚类分析,提取各类运动单位对应的典型波形模板;随后,以波形模板为基元,结合运动单位生理不应期约束构建重构误差函数,求解得到最优基元组合完成叠加片段分解;接着,整合聚类标记的独立发放时刻与分解得到的重叠放电位置,构建初始运动单位发放序列;最后,根据相邻发放间隔与生理不应期的偏离程度,对缺失放电进行等分补偿、对伪迹放电进行剔除,形成符合生理规律的修正发放序列,并关联波形模板输出最终分解结果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122388604B_ABST
    Figure CN122388604B_ABST
Patent Text Reader

Abstract

The application relates to an electromyographic signal decomposition method and system based on waveform intelligent clustering, and relates to the technical field of electromyographic signal processing, which comprises the following steps: acquiring an original electromyographic signal and constructing a waveform segment set; performing reachable distance sorting and order reconstruction on the waveform segment set to obtain a reachable distance sorting sequence; dividing the reachable distance sorting sequence into clustering clusters and marking superimposed segments; constructing a reconstruction error function, combining a physiological refractory period constraint, and solving a primitive combination that minimizes the reconstruction error and meets the physiological refractory period constraint; constructing a discharge sequence of each motor unit; according to the deviation degree of adjacent discharge intervals in the discharge sequence and the physiological refractory period, compensating for missing discharges and removing artifacts in the discharge sequence, and outputting waveform templates and corrected discharge sequences of the motor units. The application solves the problems that traditional electromyographic analysis relies on macroscopic indicators and artificial subjective judgment, the analysis result is rough, cannot be accurately quantified, and the objectivity and repeatability are insufficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electromyography (EMG) signal processing, and in particular to an EMG signal decomposition method and system based on waveform intelligent clustering. Background Technology

[0002] With the increasing demands for precision in electromyography (EMG) signal analysis in neuromuscular function assessment and exercise fatigue analysis, achieving refined and objective decoding of EMG activity has become a key technical requirement for analyzing neuromuscular control mechanisms.

[0003] Current traditional electromyography (EMG) analysis relies solely on macroscopic statistical characteristics and subjective human judgment, which cannot reproduce the details of EMG activity. The analysis results are crude, difficult to quantify, and lack objectivity and repeatability, thus failing to meet the needs of accurate assessment. Summary of the Invention

[0004] This application provides a method and system for decomposing electromyographic signals based on waveform intelligent clustering, which improves the current situation of traditional electromyographic analysis that relies on macroscopic statistics and subjective human judgment, which masks the details of electromyographic activity and results that are rough and difficult to quantify, thereby improving the objectivity and repeatability of electromyographic signal analysis.

[0005] This application discloses the following technical solution: Firstly, this application provides a method for decomposing electromyographic signals based on waveform intelligent clustering, the method comprising: The raw electromyographic signals acquired by the insertable electrodes are obtained, and the raw electromyographic signals are subjected to waveform detection and alignment to construct a set of waveform segments; Based on the similarity of waveform morphology, a density field of the waveform segment set in morphological space is constructed. The waveform segment set is then sorted by reachability distance and its order is reconstructed using an ordered clustering algorithm to obtain a reachability distance sorted sequence. The reachability distance sorting sequence is divided into clusters, and waveform segments that are not assigned to any cluster are marked as superimposed segments, wherein each cluster corresponds to a waveform template of a motion unit; For each superimposed segment, the reconstruction error function of the superimposed segment is constructed using the waveform template as the basic unit. Combined with the physiological refractory period constraint of the motion unit, the basic unit combination that minimizes the reconstruction error and satisfies the physiological refractory period constraint is solved as the decomposition result of the corresponding superimposed segment. The waveform templates and firing times corresponding to the clusters are merged with the primitives and their occurrence positions obtained from the decomposition of the superimposed segments to construct the firing sequence for each motion unit. Based on the degree of deviation between adjacent firing intervals and the physiological refractory period in the firing sequence, missing firing compensation and artifact removal are performed on the firing sequence, and waveform templates and corrected firing sequences for each motor unit are output.

[0006] Secondly, this application provides an electromyography signal decomposition system based on waveform intelligent clustering, the system comprising: The waveform acquisition and construction module is used to acquire the raw electromyographic signals acquired by the insertable electrodes, perform waveform detection and alignment on the raw electromyographic signals, and construct a set of waveform segments. The density clustering and sorting module is used to construct the density field of the waveform segment set in the shape space based on the similarity of waveform shape, and to sort and reconstruct the order of the waveform segment set by reachability distance through an ordered clustering algorithm to obtain the reachability distance sorted sequence. The cluster generation module is used to divide the reachability distance sorting sequence into clusters and mark waveform segments that are not assigned to any cluster as superimposed segments, wherein each cluster corresponds to a waveform template of a motion unit; The superimposed waveform decomposition module is used to construct a reconstruction error function for each superimposed segment using the waveform template as the basic unit, and to solve for the basic unit combination that minimizes the reconstruction error and satisfies the physiological refractory period constraint of the motion unit, which is used as the decomposition result of the corresponding superimposed segment. The firing sequence construction module is used to merge the waveform template and firing time corresponding to the cluster with the primitives and occurrence positions obtained from the decomposition of the superimposed segment to construct the firing sequence of each motion unit; The sequence correction output module is used to compensate for missing firings and remove artifacts in the firing sequence based on the degree of deviation between adjacent firing intervals and the physiological refractory period, and output the waveform template of each motor unit and the corrected firing sequence.

[0007] One or more technical solutions provided in this application have at least the following technical effects or advantages: This application proposes a method and system for decomposing electromyographic (EMG) signals based on waveform intelligent clustering. Through steps such as segmenting the original EMG signal and selecting effective superimposed segments, waveform feature extraction and intelligent clustering, generation of typical waveform templates, constraint-based optimization decomposition of superimposed segments, construction of motor unit firing sequences, compensation for missing firing times, and artifact removal, it achieves accurate separation of motor unit discharge waveforms and complete reconstruction of firing times under complex superimposed EMG signals. First, the original EMG signal is segmented to select effective segments with multiple superimposed motor units. Then, cluster analysis is performed based on waveform features to extract typical waveform templates corresponding to various types of motor units. Subsequently, using the waveform templates as primitives and combining them with constraints on the physiological refractory period of motor units, a reconstruction error function is constructed, and the optimal primitive combination is obtained to complete the decomposition of superimposed segments. Next, the independent firing times marked by clustering and the overlapping firing positions obtained from the decomposition are integrated to construct an initial motor unit firing sequence. Finally, based on the deviation between adjacent firing intervals and the physiological refractory period, missing firings are equally compensated, and artifact firings are removed to form a corrected firing sequence that conforms to physiological laws. The final decomposition result is then output in conjunction with the waveform templates.

[0008] The technical solution of this application solves the problems of traditional surface electromyography analysis, which relies solely on subjective human judgment, resulting in rough results, difficulty in quantifying neuromuscular control mechanisms and fatigue sources, and lack of objectivity and repeatability. At the same time, it overcomes the defects of insufficient accuracy in complex waveform decomposition, easy omission of overlapping discharges, missing firing timing, and artifact interference, making motor unit identification and firing timing analysis more objective and repeatable. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0010] Figure 1 A flowchart illustrating an electromyographic signal decomposition method based on waveform intelligent clustering, provided for an embodiment of this application; Figure 2 This is a schematic diagram of the structure of an electromyography signal decomposition system based on waveform intelligent clustering, provided in an embodiment of this application.

[0011] The components represented by each number in the attached diagram are explained below: Waveform acquisition and construction module 01, density clustering and sorting module 02, cluster generation module 03, superimposed waveform decomposition module 04, output sequence construction module 05, and sequence correction and output module 06. Detailed Implementation

[0012] This application provides a method and system for decomposing electromyographic signals based on waveform intelligent clustering, which solves the technical problems in the prior art that rely solely on macroscopic statistical analysis, depend on subjective human judgment, mask the details of electromyographic activity, produce coarse analysis results, are difficult to quantify neuromuscular control mechanisms, and lack objectivity and repeatability.

[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0014] Example 1, as shown in the appendix Figure 1 As shown, this application provides a method for decomposing electromyographic signals based on waveform intelligent clustering, the method comprising the following steps: S110: Acquire the raw electromyographic signals collected by the insertable electrodes, perform waveform detection and alignment on the raw electromyographic signals, and construct a set of waveform segments; In this embodiment of the application, in the scenario of electromyography signal decomposition, in order to accurately extract effective waveforms and eliminate noise interference, signal preprocessing and waveform screening alignment need to be completed first to improve the stability and accuracy of subsequent clustering and decomposition.

[0015] First, the original electromyography (EMG) signal is preprocessed using a bandpass filter to obtain a filtered EMG signal, which removes high-frequency noise and low-frequency drift components from the signal.

[0016] Next, the median absolute deviation is calculated based on the amplitude distribution of the filtered electromyographic signal. Based on this, the waveform detection threshold is determined, and the intervals where the amplitude continuously exceeds the detection threshold are selected as candidate waveforms, thus retaining the real and effective electromyographic activity segments.

[0017] Furthermore, each candidate waveform is shifted along the time axis based on the point of maximum amplitude within the interval, so that all candidate waveforms are aligned and the time offset difference of the waveforms is eliminated.

[0018] Finally, the morphological distance between the aligned waveform segments is calculated, and an upper limit threshold is set based on the interquartile range. Abnormal segments with excessive morphological differences are removed, and the remaining valid segments are integrated into a regular and uniform set of waveform segments.

[0019] This step, through a series of processes including filtering, detection, alignment, and anomaly removal, provides the foundational data for subsequent waveform clustering and superposition decomposition, ensuring the authenticity and reliability of the decomposition results.

[0020] Step S110 in the method provided in this application embodiment includes: The original electromyography (EMG) signal is preprocessed based on bandpass filtering to obtain the filtered original EMG signal. Calculate the absolute deviation of the median based on the amplitude distribution of the original electromyographic signal after filtering; Using a fixed multiple of the absolute deviation of the median as the detection threshold, waveform intervals whose amplitudes continuously exceed the detection threshold are extracted from the filtered original electromyography signal as candidate waveforms. For each candidate waveform, the point with the largest amplitude within the waveform interval is used as the alignment reference. Multiple candidate waveforms are translated on the time axis to coincide with the alignment reference to obtain the aligned waveform segment. Calculate the morphological distance between each pair of aligned waveform segments, remove waveform segments whose morphological distance is greater than the upper limit threshold based on the interquartile range, and add the remaining waveform segments to the waveform segment set.

[0021] First, insertable electrodes are inserted into the target muscle tissue to collect deep electromyographic signals via a minimally invasive method, thereby obtaining raw electromyographic activity data with high signal-to-noise ratio and high resolution. The insertable electrodes are detection devices that are directly inserted into the muscle to capture the discharge of individual motor units. They typically employ a fine needle-shaped metal conductor design, which reduces damage to muscle tissue while improving the accuracy of picking up local discharge signals.

[0022] Furthermore, bandpass filtering preprocessing is performed on the raw electromyography signals acquired by the insertable electrodes to filter out noise and baseline drift, while preserving effective electromyography waveform characteristics.

[0023] Bandpass filtering removes high-frequency electromagnetic interference and low-frequency baseline drift from the signal that are outside the effective frequency band of electromyography (EMG), while retaining the core frequency components that reflect the activity of motor units. This makes subsequent amplitude statistics and waveform detection more closely resemble the characteristics of the real signal. After bandpass filtering, irrelevant components such as power frequency interference and motion artifacts in the original signal are suppressed, resulting in a stable and clear filtered EMG signal.

[0024] Based on the filtered signal, the median absolute deviation is calculated according to the amplitude distribution to robustly estimate the noise level of the signal. In practice, the amplitudes of all sampling points of the filtered electromyography signal are first extracted into a one-dimensional amplitude sequence, then the median of the sequence is calculated. Subsequently, the absolute deviation of the amplitude of each sampling point from the median is calculated, and finally the median of all absolute deviations is taken as the median absolute deviation.

[0025] Among them, the median absolute deviation is not affected by extreme abnormal amplitudes and is more suitable for noise estimation of electromyographic signals than the standard deviation. For example, if the amplitude sequence of a filtered signal is [2, 3, 3, 4, 5, 5, 6], the median is 4, the absolute deviations of each point are [2, 1, 1, 0, 1, 1, 2], and the corresponding median absolute deviation is 1, which can stably characterize the noise intensity of the current signal.

[0026] Next, a detection threshold is set by a fixed multiple of the absolute deviation of the median to accurately distinguish between valid waveforms and noise, and to avoid false detections and missed detections.

[0027] The fixed multiplier is usually 3 to 5 times. This range is determined based on the noise distribution characteristics of electromyographic signals. 3 times can cover most stable noise ranges, while 5 times is suitable for acquisition scenarios with slightly stronger noise. This ensures that the real waveform is effectively detected and avoids false detections caused by noise pulses.

[0028] Using the example above, with a median absolute deviation of 1, and taking 4 times as the detection threshold, the detection threshold becomes 4. Only intervals where the amplitude continuously exceeds 4 will be considered valid waveform intervals. Based on this threshold, waveform intervals where the amplitude continuously exceeds the threshold are extracted from the original electromyography signal to form candidate waveforms, eliminating scattered noise points and low-amplitude interference segments.

[0029] After obtaining the candidate waveforms, a time alignment operation is performed on all candidate waveforms. Specifically, the point with the largest amplitude within each candidate waveform interval is used as the alignment reference point. All candidate waveforms are translated as a whole on the time axis so that the maximum amplitude points of all waveforms are aligned to the same time position, eliminating the time offset caused by different release times. For example, if the maximum amplitude points of three candidate waveforms appear at points 10, 12, and 14 respectively, after being uniformly aligned to point 12, the waveforms are completely aligned on the time axis, which facilitates subsequent morphological similarity calculation.

[0030] After alignment, the morphological distance between each pair of waveform segments is calculated. Specifically, Euclidean distance is used as the morphological distance metric, which is obtained by taking the square root of the sum of the squares of the differences between corresponding sampling points of two waveforms of equal length. The smaller the distance, the more similar the waveforms are, and the larger the distance, the greater the morphological difference.

[0031] Subsequently, an upper threshold for outlier removal was set based on the interquartile range to stably identify and remove abnormal waveform segments with excessively large morphological distances. This rule adopts the outlier determination criteria of statistical box plots (using only the upper threshold), which is insensitive to extreme values, has strong robustness, and can objectively determine outliers, avoiding the impact of noise on the accuracy of the threshold.

[0032] Specifically, the calculation first involves sorting all morphological distances in ascending order, then calculating the 25th percentile Q1 and the 75th percentile Q3 to obtain the interquartile range I.QR =Q3-Q1, upper limit threshold is Q3+1.5×I QR Calculations show that this rule conforms to the statistical criteria for identifying outliers in box plots and can reliably identify outliers with abnormal morphology.

[0033] For example, after sorting a set of morphological distances, Q1=2, Q3=5, I QR =3, upper limit threshold =5 + 1.5 × 3 = 9.5, segments with a morphological distance greater than 9.5 are considered outliers and are directly removed.

[0034] Finally, the remaining waveform segments after outlier removal are integrated to form a standardized waveform segment set. After the complete processing of filtering, detection, alignment, and outlier removal, only valid waveforms with regular shape, controllable noise, and time alignment are retained in the segment set, which can significantly improve the accuracy and stability of subsequent density clustering, superposition decomposition, and emission sequence construction.

[0035] S120: Based on the similarity of waveform morphology, construct the density field of the waveform segment set in the morphology space, and use an ordered clustering algorithm to sort the waveform segment set by reachability distance and reconstruct its order to obtain a reachability distance sorted sequence; In this embodiment of the application, in order to achieve adaptive grouping and accurately distinguish between independent waveforms and superimposed waveforms, it is necessary to first construct a density field and complete the reachability sorting to improve the adaptability and accuracy of the clustering results to non-spherical distributions.

[0036] First, the morphological distance between any two waveform segments is used as a similarity measure, and two waveform segments whose morphological distance is less than the neighborhood radius are determined to be adjacent. The neighborhood radius is a lower limit threshold calculated based on the interquartile range.

[0037] Furthermore, the number of adjacent waveform segments in the morphological space for each waveform segment is counted, and this number is used as the density value of the corresponding waveform segment. The morphological space density field is constructed based on the density value distribution of all waveform segments.

[0038] Next, the minimum number of core points is determined based on the overall sample size of the waveform segment set, and waveform segments with a density value greater than or equal to the minimum number of core points are uniformly marked as core points.

[0039] Finally, select any core point as the starting point of the iteration, and continue to expand according to the rule of minimum reachability. Visit all waveform segments one by one and record the reachability simultaneously. Finally, generate an ordered sequence and the corresponding reachability sequence as the reachability sorted sequence after the order reconstruction is completed.

[0040] This step, through density field construction and reachability distance sorting, provides a regular and orderly data foundation for subsequent cluster division and superimposed segment identification, making waveform grouping more consistent with actual morphological distribution characteristics and ensuring stable and reliable clustering results.

[0041] Step S120 in the method provided in this application embodiment includes: The morphological distance between any two waveform segments is used as a similarity measure. Two waveform segments with a morphological distance less than the neighborhood radius are defined as adjacent to each other. The neighborhood radius is taken as a lower limit threshold based on the interquartile range. The number of adjacent waveform segments in the morphological space for each waveform segment is counted and used as the density value of the waveform segment. The density field is constructed based on the density value distribution of all waveform segments. The minimum number of core points is determined based on the sample size of the waveform segment set, and waveform segments with a density value greater than or equal to the minimum number of core points are marked as core points. Starting from any core point, the system iteratively expands according to the principle of prioritizing the minimum reachable distance, sequentially accessing waveform segments and recording reachable distances to generate an ordered sequence and a corresponding reachable distance sequence, which serve as the reachable distance sorting sequence.

[0042] First, the morphological distance between waveform segments is used as a similarity measure to determine whether the waveform segments are adjacent to each other. The smaller the morphological distance, the closer the waveform shapes are, and the higher the probability that they belong to the same motion unit.

[0043] Furthermore, two waveform segments with a morphological distance less than the neighborhood radius are defined as adjacent. The neighborhood radius is directly adopted as the lower limit threshold calculated based on the interquartile range, specifically set to "Q1-1.5×I". QR This value can exclude invalid pairings with excessively large morphological distances, ensuring that adjacency relationships only occur between highly similar waveforms, and preventing segments with obvious morphological differences from being incorrectly associated.

[0044] Next, after defining the adjacency rules, all waveform segments are traversed, and the number of adjacent waveform segments in the shape space for each waveform segment is counted. This number is then used as the density value of the current waveform segment. A higher density value indicates that more similar waveforms cluster around the segment, making it more likely to become a cluster center.

[0045] Then, all waveform segments and their corresponding density values ​​are uniformly arranged in the shape space to form a complete density value distribution. This distribution is the density field used for cluster support, which can intuitively reflect the degree of clustering of waveform segments in the shape space.

[0046] For example, a set of waveform segments is calculated to have a morphological distance of Q1=2, I QR=2, then the neighborhood radius = 2 - 1.5 × 2 = -1. At this point, 0 is taken as the effective lower limit, and only segments with a morphological distance of 0 are judged as adjacent. If there are 6 waveforms around a segment that satisfy the adjacency condition, then the density value of the waveform segment is recorded as 6, and it is represented as a high-density clustering candidate center in the density field.

[0047] Furthermore, the minimum number of core points is adaptively determined based on the sample size of the waveform segment set, and waveform segments with a density value greater than or equal to the minimum number of core points are marked as core points, so as to select waveform segments that are densely clustered and highly representative in the morphological space as the clustering expansion benchmark.

[0048] The method provided in this application embodiment determines the minimum number of core points based on the sample size of the waveform segment set, including: Obtain the total number of waveform segments in the waveform segment set, and use this as the sample size; Calculate the base-2 logarithm of the sample size, and round the logarithm down to obtain the baseline value; If the benchmark value is less than the minimum lower limit, then the minimum number of core points is taken as the minimum lower limit, wherein the minimum lower limit is determined as a first constant based on the minimum sample size required to form a meaningful cluster. If the benchmark value is greater than the maximum upper limit value, then the minimum number of core points is taken as the maximum upper limit value. The maximum upper limit value is determined as a second constant based on the ratio of the sample size of the waveform segment set to the neighborhood radius, and the second constant is not less than the first constant. Otherwise, the minimum number of core points shall be taken as the baseline value.

[0049] Specifically, the total number of waveforms contained within the waveform segment set is first counted, and this total number is directly defined as the sample size. The sample size is a direct indicator of the data volume and is also the basis for adaptive calculation.

[0050] After obtaining the sample size, the base-2 logarithm of the sample size is calculated, and the result is rounded down to obtain the baseline value. The base-2 logarithm is used because the logarithmic function can smoothly map the numerical changes of large-scale data, allowing the baseline value to grow steadily with the sample size without drastic fluctuations, thus adapting to clustering needs under different data volumes.

[0051] Furthermore, based on clustering effectiveness and sample statistical regularities, a minimum lower limit value is set. Specifically, considering that electromyography waveform clustering requires sufficient sample representativeness, the minimum lower limit value is set to 3. This value is a fixed first constant, determined based on the statistical principle that at least 3 samples are needed to form an effective cluster. If the benchmark value is lower than 3, the threshold for determining core points will be too low, leading to a large number of edge segments being misjudged as core points, resulting in excessive cluster splitting.

[0052] For example, with a sample size of 5, the base-2 logarithm is approximately 2.32. Rounding down gives a baseline value of 2, which is less than the minimum lower limit of 3. Therefore, the minimum number of core points is directly assigned the value of 3.

[0053] Simultaneously, based on the waveform segment distribution density and neighborhood range constraints, a maximum upper limit is set. Considering the distribution characteristics of electromyographic signal morphology space, to avoid overly coarse clustering, the maximum upper limit is set to 10. This value is a fixed second constant and is not less than the minimum lower limit. The maximum upper limit is obtained by rounding down the ratio of sample size to neighborhood radius, used to limit the threshold for core point determination from being too high. If the baseline value exceeds 10, effective clusters will be forcibly merged, resulting in the loss of true waveform classification features.

[0054] For example, with a sample size of 2000, the base-2 logarithm is approximately 11. Rounding down gives a baseline value of 11, which is greater than the maximum upper limit of 10. Therefore, the minimum number of core points is limited to 10.

[0055] Conversely, if the baseline value lies between the minimum lower limit and the maximum upper limit (i.e., greater than or equal to 3 and less than or equal to 10), then the baseline value is directly used as the minimum number of core points. For example, with a sample size of 100, the base-2 logarithm is approximately 6.64. Rounding down gives a baseline value of 6, which falls within the range of 3 to 10, so the minimum number of core points is 6.

[0056] Based on the above hierarchical judgment rules, the minimum number of core points can be dynamically adjusted according to the sample size, adapting to electromyography waveform clustering in all scenarios from small samples to large samples. This ensures that the clustering results are effective under small sample data and avoids clustering anomalies under large sample data.

[0057] Furthermore, after determining the minimum number of core points, all waveform segments are traversed, and waveform segments with a density value greater than or equal to the minimum number of core points are marked as core points.

[0058] Among them, the core points represent waveform segments with high aggregation and stable characteristics in the morphological space, which can reflect the typical discharge mode of the same motion unit, while non-core points are mostly edge segments or superimposed interference segments, thus completing the selection of cluster centers.

[0059] After marking all core points, an unvisited core point is used as the starting point for iteration. The waveform segment is traversed and expanded according to the rule of prioritizing the minimum reachable distance. The reachable distance is recorded synchronously and an ordered sequence is generated to provide a clear order basis for subsequent clustering.

[0060] The method provided in this application embodiment starts from any core point, iteratively expands according to the principle of prioritizing the minimum reachable distance, sequentially visits waveform segments and records reachable distances, generates an ordered sequence and a corresponding reachable distance sequence, which serve as the reachable distance sorting sequence, including: Take any unvisited core point as the current starting point, mark the current starting point as visited, add it to the ordered sequence, and simultaneously record the reachability distance of the current starting point as zero; Collect all unvisited adjacent waveform segments from the current starting point, and calculate the reachability distance of each adjacent waveform segment relative to the current starting point; The calculated reachable distance is used as the current reachable distance of the corresponding adjacent waveform segment in the seed queue, wherein the seed queue is a set used to store the waveform segments to be visited and their current reachable distances, and the current reachable distance is dynamically updated during the iteration process; Select the waveform segment with the smallest reachable distance from the seed queue as the next access point, mark the next access point as visited, add it to the ordered sequence, and record the reachable distance of the next access point; If the next access point is a core point, then collect all unvisited adjacent waveform segments of the next access point and calculate the reachability distance of each adjacent waveform segment relative to the next access point. If the calculated reachable distance is less than the current reachable distance of the adjacent waveform segment in the seed queue, then update the reachable distance in the seed queue; Repeatedly select the waveform segment with the smallest reachable distance from the seed queue as the next access point and perform the corresponding update operation until the seed queue is empty; If there are unvisited waveform segments, select the unvisited core point as the new current starting point, repeat the expansion and update process until all waveform segments are visited, and output an ordered sequence and the corresponding reachable distance sequence.

[0061] Specifically, firstly, among all the marked core points, any unvisited core point is selected as the current starting point. This starting point is marked as visited and added to the ordered sequence, while its reachability distance is initialized to zero. Here, a reachability distance of zero indicates that the current segment is the starting core of the cluster expansion and is the benchmark point with the highest morphological similarity.

[0062] Subsequently, all unvisited adjacent waveform segments from the current starting point are collected, and the reachability distance of each adjacent segment relative to the current starting point is calculated to quantify the morphological similarity and clustering density between waveform segments.

[0063] Specifically, for the current starting point p, which serves as the core point, the reachable distance of its adjacent segment q is the larger of the core distance of p and the morphological distance between p and q. The core distance is the minimum neighborhood radius that makes the current segment a core point, equal to the morphological distance between the segment and its k-th nearest neighbor segment, where k is the minimum number of core points already determined, objectively reflecting the density of core segment clustering. If the current segment is not a core point, its reachable distance is considered infinite and it does not participate in normal expansion.

[0064] For example, if the core distance of the current starting point p is 2 and the morphological distance between p and the adjacent segment q is 1.5, then the reachable distance is the larger of the two, which is 2; if the morphological distance is 2.5, then the reachable distance is updated to 2.5, thus objectively reflecting the correlation strength between segments.

[0065] Furthermore, the calculated reachable distances are bound to the corresponding waveform segments and stored in a seed queue. The seed queue stores the waveform segments to be accessed and their real-time reachable distances. All values ​​are dynamically updated during the iteration process to ensure that the minimum reachable distance is always retained for subsequent filtering.

[0066] Next, the waveform segment with the smallest reachable distance is selected from the seed queue as the next access point, marked as visited, and added to the ordered sequence, while the reachable distance of this segment is recorded simultaneously. Adopting the rule of prioritizing the smallest reachable distance ensures that cluster expansion always proceeds along the direction of greatest morphological similarity, conforming to the natural distribution pattern of electromyographic signal waveforms.

[0067] If the next access point selected is also a core point, then all unvisited adjacent waveform segments of that point are collected, and the corresponding reachable distances are recalculated. If the newly calculated reachable distance is less than the current value of that segment in the seed queue, the value in the seed queue is updated to ensure that the segment to be accessed always retains the optimal reachable distance.

[0068] Furthermore, the operations of filtering the minimum reachable segment, marking the access, expanding adjacent segments, and updating the seed queue are repeated until there are no more segments to be accessed in the seed queue.

[0069] Conversely, if there are still unvisited waveform segments after the traversal is completed, it indicates that there are independent clustering branches. At this time, a new unvisited core point is selected as the current starting point, and the complete expansion and update process is repeated until all waveform segments are marked as visited.

[0070] For example, the current starting point is the core point. The reachable distances of the three adjacent segments are calculated to be 1.5, 3.2 and 4.8 respectively. The segment with a reachable distance of 1.5 is selected as the next access point. After this segment becomes the core point, the expansion continues. The reachable distance of the newly calculated adjacent segment is 1.2. If it is less than the original value of the seed queue, the update is completed until the current branch is traversed.

[0071] Finally, the ordered sequence of waveform segments generated based on the complete access order, along with the synchronously recorded sequence of reachable distance values, together constitute the final reachable distance sorted sequence. This sequence fully preserves the morphological similarity and spatial clustering characteristics between waveform segments, and can adapt to non-spherically distributed electromyographic waveform data without the need for manually pre-setting the number of clusters, providing a data foundation for subsequent cluster division and superimposed segment recognition.

[0072] S130: Divide the reachability distance sorting sequence into clusters, and mark the waveform segments that are not assigned to any cluster as superimposed segments, wherein each cluster corresponds to a waveform template of a motion unit; In this embodiment of the application, in order to achieve automatic grouping of waveform segments and accurate differentiation between independent motion unit waveforms and superimposed interference waveforms, boundary identification and cluster division are required based on the reachable distance sorting sequence to generate high-purity motion unit waveform templates, thereby improving the accuracy and physiological significance of electromyographic signal decomposition.

[0073] Among them, the motor unit waveform is the characteristic electrical signal generated by a single neuromuscular unit during muscle contraction, and it is the core basic unit of electromyography (EMG) analysis. By performing unsupervised clustering on the reachability distance sorted sequence, waveform segments with highly similar morphology can be automatically classified into one class, directly corresponding to a real motor unit. At the same time, superimposed segments formed by multiple overlapping waveforms can be separated, effectively improving the anti-interference ability and reliability of signal decomposition.

[0074] Specifically, the complete reachability distance sorting sequence is first traversed, and positions in the sequence whose reachability distance is greater than the neighborhood radius are marked as cluster boundary points. The neighborhood radius, calculated using the lower limit threshold previously determined based on the interquartile range, is the standard for judging whether waveform segments are highly similar. When the reachability distance between adjacent waveform segments exceeds the neighborhood radius, it indicates that their morphological differences are significant and they do not belong to the same motion unit; this position is the natural cluster boundary.

[0075] Furthermore, using cluster boundary points as the dividing criterion, continuous waveform segments located between two adjacent cluster boundary points in the reachability distance sorting sequence are uniformly classified into the same cluster. Within each cluster, all segments satisfy the characteristics of high morphological similarity and tight aggregation, and can be directly used as waveform templates for a single motion unit, ensuring the purity and representativeness of the template.

[0076] After all clusters have been divided, isolated waveform segments in the reachability distance sorting sequence that have not been assigned to any cluster are marked as superimposed segments. Superimposed segments are usually generated by the temporal overlap of multiple motion unit waveforms, and their morphology is not typical, so they cannot be classified into any valid cluster. After marking, they can be removed individually or subjected to secondary decomposition.

[0077] For example, assuming the neighborhood radius calculated by the preceding sequence is 2.0, and a certain reachable distance sorted sequence is [0, 1.2, 1.6, 3.2, 1.5, 1.8, 4.1, 2.0], after traversal, the reachable distances 3.2 and 4.1 are both greater than the neighborhood radius, and are marked as cluster boundary points; the sequence is divided into three segments [0, 1.2, 1.6], [1.5, 1.8], and [2.0]. The first two consecutive segments are divided into independent clusters, corresponding to two motion unit waveform templates; the last single segment does not form an effective cluster and is marked as a superimposed segment.

[0078] Next, after the division is completed, it is necessary to verify the sample quantity and morphological consistency of each cluster, remove invalid clusters that are too small, and retain valid clusters that meet the minimum sample requirement, so as to ensure that the generated motion unit waveform template has statistical reliability.

[0079] Finally, through the above segmentation process, standardized clusters and superimposed segments can be automatically output from the original electromyographic waveform segments. Each cluster directly corresponds to a physiologically real motor unit waveform template, providing reliable data support for subsequent quantitative analysis of electromyographic signals and muscle function assessment.

[0080] S140: For each superimposed segment, using the waveform template as the basic element, construct the reconstruction error function of the superimposed segment, and combine it with the physiological refractory period constraint of the motion unit to solve the basic element combination that minimizes the reconstruction error and satisfies the physiological refractory period constraint, as the decomposition result of the corresponding superimposed segment; In this embodiment of the application, in order to restore the actual motor unit discharge components contained in the superimposed segment, it is necessary to construct an error function based on the obtained waveform template, and at the same time introduce physiological prior constraints to screen feasible solutions, so as to ensure that the decomposition result is both consistent with the signal characteristics and conforms to the laws of muscle electrophysiological activity.

[0081] First, the time window range of the superimposed segment on the time axis is determined. With the length of the waveform template as the step size, the candidate occurrence position set of each waveform template is discretized within the time window range to provide a positional basis for subsequent primitive combination enumeration.

[0082] Furthermore, a physiological refractory period constraint for the motion unit is introduced. This constraint limits the occurrence of the same waveform template at most once within the superimposed segment, and the interval between the occurrence positions of any two waveform templates is not less than the number of sampling points corresponding to the physiological refractory period, thus avoiding continuous discharges that violate physiological laws in the decomposition results.

[0083] Under the premise of satisfying the physiological refractory period constraint, enumerate all feasible solutions of primitive combinations in the candidate occurrence position set, and eliminate all combinations that do not conform to the physiological rules.

[0084] For each feasible primitive combination obtained from the enumeration, the sum of squared residuals between the superimposed segment and the weighted superposition result of all waveform templates is constructed using the amplitude scaling factor of each waveform template in the combination at the corresponding candidate occurrence position as a variable, and this sum is used as the reconstruction error function.

[0085] Next, the amplitude scaling factor that minimizes the reconstruction error function is solved, and the corresponding reconstruction error is obtained based on the calculated factor. Then, from all feasible primitive combinations, the group with the smallest reconstruction error is selected as the final decomposition result of the current stacked segment.

[0086] This step combines physiological constraints with error optimization to achieve precise decomposition of superimposed segments, restoring complex superimposed waveforms to several standard motion unit waveforms, making the overall electromyographic signal decomposition results more complete and reliable.

[0087] Step S140 in the method provided in this application embodiment includes: Determine the time window range of the superimposed segment on the time axis, and discretize the candidate occurrence position set of each waveform template within the time window range using the length of the waveform template as the step size; A physiological refractory period constraint for motion units is introduced, wherein the physiological refractory period constraint limits the same waveform template to appear at most once within the superimposed segment, and the interval between the appearance positions of any two waveform templates is not less than the number of sampling points corresponding to the physiological refractory period; Under the condition of satisfying the physiological refractory period constraint, enumerate all feasible solutions for the combination of primitives in the candidate occurrence position set; For each enumerated feasible primitive combination, the amplitude scaling factor of each waveform template in the feasible primitive combination at the corresponding candidate occurrence position is used as a variable to construct the residual sum of squares between the superimposed segment and the weighted superimposed result of all waveform templates, which is used as the reconstruction error function. Solve for the amplitude scaling factor that minimizes the reconstruction error function, and calculate the corresponding reconstruction error based on the obtained amplitude scaling factor; The combination of primitives with the smallest reconstruction error is selected as the decomposition result of the superimposed segment.

[0088] Specifically, the time window range of the superimposed segment on the time sampling axis is determined by locating the start and end sampling points of the superimposed segment on the time sampling axis of the original electromyography signal. Then, with the length of the waveform template as the step size, the candidate occurrence position set of each waveform template is discretized within the obtained time window range, thereby providing a standardized position basis for subsequent primitive combination enumeration.

[0089] The method provided in this application embodiment determines the time window range of the superimposed segment on the time axis, and discretizes and generates a set of candidate occurrence positions for each waveform template within the time window range, using the length of the waveform template as the step size, including: The time window range is defined by the start and end sampling points of the superimposed segments on the time axis, wherein the time axis is the time sampling axis of the original electromyographic signal; Using the length of the waveform template as the step size, within the time window, according to the number of sampling points corresponding to the physiological refractory period, candidate occurrence positions are generated for each waveform template, such that the interval between any two candidate occurrence positions is not less than the number of sampling points corresponding to the physiological refractory period. The generated candidate occurrence positions are arranged in chronological order to form a set of candidate occurrence positions for each waveform template.

[0090] Specifically, the starting and ending sampling points of the superimposed segments on the time sampling axis of the original electromyographic signal are first located to completely define the time window range of the superimposed segments.

[0091] The time sampling axis is a scale axis formed by discrete sampling of electromyographic signals at a fixed sampling frequency by the electromyographic signal acquisition device. Each value corresponds to an independent sampling time and is the unique reference for locating the position of all waveform segments. By defining the time window through the start and end sampling points, the entire waveform data of the superimposed segment can be completely encompassed, avoiding the loss of effective signals due to the time window range being too small, or the introduction of irrelevant interference sampling points due to the range being too large.

[0092] Furthermore, with the length of the waveform template as a fixed step size, and following the sampling point interval corresponding to the physiological refractory period, candidate occurrence positions of each waveform template are generated one by one within the defined time window.

[0093] Among them, the physiological refractory period is the core parameter of the physiological characteristics of motor units. It refers to the minimum recovery time that a single motor unit must undergo after completing one discharge. During this period, a second effective discharge cannot be generated. The number of sampling points corresponding to the physiological refractory period is determined based on the sampling frequency of the electromyographic signal. When the conventional sampling frequency is 10kHz, the physiological refractory period is taken as 20 to 50 sampling points (the value range can be adaptively adjusted according to the sampling rate of the specific acquisition device and the muscle type), corresponding to a physical time of 2ms to 5ms. This value conforms to the real electrophysiological recovery law of skeletal muscle motor units and can avoid combinations that violate physiological rules from the position generation stage.

[0094] Furthermore, generating candidate positions using the waveform template length as the step size ensures that the template completely matches the waveform structure of the superimposed segment at the corresponding position, thus ensuring the alignment accuracy of subsequent weighted superposition and error calculation.

[0095] At the same time, it is mandatory that the interval between all candidate occurrence positions is no less than the number of sampling points during the physiological refractory period, thereby eliminating unreasonable positions from the source and reducing the complexity of subsequent enumeration calculations.

[0096] For example, the sampling frequency of the original electromyography signal is 10kHz, the time window range of the superimposed segment is from the 200th sampling point to the 320th sampling point, the waveform template length is 40 sampling points, and the number of sampling points corresponding to the physiological refractory period is 20. Then, candidate positions are generated with a step size of 40 and a minimum interval of 20, and the 200th, 240th, 280th and 320th sampling points are obtained in sequence. The interval between all adjacent positions meets the physiological constraint requirements.

[0097] Furthermore, all generated candidate occurrence positions are arranged sequentially according to the timeline, ultimately forming an independent set of candidate occurrence positions for each waveform template. This set of candidate occurrence positions is characterized by temporal order, physiological compliance, and length matching, and can be used for recursive enumeration and filtering of subsequent primitive combinations.

[0098] After constructing the candidate occurrence location set, a physiological refractory period constraint for motor units is introduced. This constraint limits the occurrence of the same waveform template to at most once within the stacked segment, and the interval between the occurrence locations of any two waveform templates is not less than the number of sampling points corresponding to the physiological refractory period. This constraint conforms to the electrophysiological laws of skeletal muscle motor units, avoiding excessively dense discharges or repeated counting of the same motor unit in the decomposition results, thus ensuring the physiological rationality of the decomposition results.

[0099] Furthermore, under the constraint of physiological refractory period, all feasible solutions for the combination of primitives in the candidate occurrence position set are enumerated. In specific execution, the candidate occurrence positions of each waveform template are first arranged in chronological order to form an independent candidate position list for each template.

[0100] Next, following the timeline, primitive combinations are recursively selected starting from the earliest candidate position. Each selection checks if the constraints are met. If the current candidate position is too close to a previously selected position or the current template has already been selected, that position or template is skipped, achieving pruning optimization and improving enumeration efficiency. After the recursion is complete, all primitive combinations that meet the constraints are collected, forming a set of candidate solutions to be evaluated.

[0101] For example, if the candidate occurrence position set includes the position of template A [200, 240, 280] and the position of template B [220, 260, 300], and the number of sampling points during the physiological refractory period is 20, then the combination {A(200), B(220)} is eliminated because the interval is less than the number of sampling points during the physiological refractory period, while the combination {A(200), B(240)} is retained as a feasible solution because the interval meets the requirement.

[0102] Furthermore, for each enumerated feasible primitive combination, the sum of squared residuals between the superimposed segment and the weighted superposition result of all waveform templates is constructed as the reconstruction error function, using the amplitude scaling factor of each waveform template in the combination at the corresponding candidate occurrence position as the variable.

[0103] The amplitude scaling factor is a linear coefficient used to adjust the waveform template amplitude to match the actual discharge intensity of the superimposed segment. It reflects the proportion of the discharge amplitude of the corresponding motor unit in the current superimposed segment. The value is non-negative, which is consistent with the physical meaning of non-negative electromyographic signal amplitude.

[0104] In addition, the reconstruction error function takes the sum of squared residuals of the weighted superposition of the superimposed segments and the waveform templates of each primitive as its core form, which intuitively quantifies the fitting difference between the original superimposed signal and the template reconstructed signal. The smaller the value, the higher the degree of restoration of the superimposed segments by the primitive combination.

[0105] Specifically, let S be the superimposed segment, and let m be the primitives in the combination. Let T be the waveform of the j-th primitive after the waveform template is translated to the position where it appears. j The scaling factor is denoted as a. j The reconstruction error function can then be expressed as " ".in, This represents the sum of squared residuals, i.e., the weighted summation of the stacked segment S with each primitive. The function sums the squared differences at all sampling points, which intuitively quantifies the fitting difference between the original superimposed segments and the template weighted superimposed results. The smaller the value, the better the fitting effect.

[0106] Furthermore, the amplitude scaling factor that minimizes the reconstruction error function is solved. This process is essentially a linear least squares problem. By taking the partial derivative of the error function and setting the derivative to zero, a closed-form solution for the amplitude scaling factor can be obtained, ensuring both solution efficiency and optimal results.

[0107] Next, the obtained amplitude scaling coefficients are substituted back into the reconstruction error function to calculate the reconstruction error corresponding to the feasible primitive combination. For example, if a feasible primitive combination contains two primitives, and the obtained amplitude scaling coefficients are a1=0.8 and a2=1.2, the reconstruction error calculated after substituting them into the function is 12.6, which is the fitting error value of the combination.

[0108] Finally, the combination with the smallest reconstruction error is selected from all feasible primitive combinations as the decomposition result of the current superimposed segment. This combination satisfies the physiological refractory period constraint of the motion unit and can fit the original superimposed waveform to the greatest extent, thus restoring the discharge components of all independent motion units contained in the superimposed segment.

[0109] By enumerating constraints, constructing error functions, and solving for the optimal solution, the superimposed segments were refined and the complex overlapping waveforms were transformed into standard motion unit waveforms that conform to physiological laws, providing a reliable data foundation for subsequent quantitative analysis of electromyography signals and assessment of muscle function.

[0110] S150: The waveform template and firing time corresponding to the cluster are merged with the primitives and their occurrence positions obtained from the decomposition of the superimposed segment to construct the firing sequence of each motion unit; In this embodiment of the application, in order to fully restore the actual discharge pattern of a single motion unit throughout the entire time period, it is necessary to integrate the dual results of clustering and superimposed segment decomposition, and to uniformly merge the discrete discharge time and the decomposition occurrence position to construct an accurate and continuous motion unit discharge time sequence.

[0111] Among them, motor unit firing sequences are core data reflecting the firing frequency and temporal distribution of individual neuromuscular units during muscle contraction, and are a key foundation for quantitative analysis of electromyography signals, muscle function assessment, and movement pattern recognition. By integrating clustering and superimposed fragment decomposition results, both independent and overlapping firing scenarios can be covered, avoiding omission of firing events in superimposed states and ensuring the integrity and accuracy of firing sequences.

[0112] First, by integrating the independent discharge data of clusters with the overlapping discharge data of superimposed fragments, a firing sequence of moving units is constructed to cover all discharge events in both independent and overlapping discharge scenarios, thereby restoring the true discharge time sequence of a single moving unit throughout the entire time period.

[0113] Specifically, each cluster is first traversed to obtain the waveform template corresponding to the cluster and all firing moments recorded by the waveform template during the clustering process. The firing moment is the peak position of the independent waveform segment marked in the clustering stage on the time sampling axis of the original electromyographic signal, representing a clear and independent firing event of the motor unit. This moment has been accurately calibrated in the previous waveform detection and alignment steps.

[0114] For example, a certain cluster corresponds to waveform template A. The emission times recorded during the clustering process are the 120th, 250th, and 380th sampling points, which correspond to three independent discharge events. These times are directly used as the basic emission data of the motion unit.

[0115] Furthermore, the decomposition results of all superimposed segments are traversed to obtain all occurrence positions where the primitives in the decomposition results match the waveform template. When a primitive obtained from the decomposition of a superimposed segment matches a certain waveform template, its occurrence position is the discharge time of that motion unit in the overlapping state. This position has already undergone physiological compliance verification in the candidate position generation and constraint enumeration stage, and can accurately reflect the true timing of the overlapping discharge.

[0116] For example, the decomposition result of a certain superimposed segment contains primitives that match the waveform template A, which appear at the 180th and 310th sampling points. This indicates that the motion unit experienced two overlapping discharge events between two independent discharges. These positions supplement the overlapping scene not covered by the independent discharge moments.

[0117] Next, the acquired discharge times and locations are merged into a set of time points corresponding to the same waveform template. Using the time sampling axis as a reference, all time points in the set are rearranged in chronological order to finally construct a complete discharge sequence for the motion unit corresponding to the waveform template. This discharge sequence includes both the independent discharge times identified in the clustering stage and the overlapping discharge positions obtained from the decomposition of superimposed segments, fully covering all discharge events of the motion unit throughout the entire time period.

[0118] For example, the release time [120, 250, 380] and the occurrence position [180, 310] of waveform template A are combined and arranged in chronological order to obtain the release sequence [120, 180, 250, 310, 380], which accurately restores the complete discharge sequence of the motion unit within the target time period.

[0119] Finally, after completing the construction of the firing sequence for all waveform templates, the sequence needs to be time-series verified to remove time points that are repeated or have abnormal intervals due to calculation errors, so as to ensure that the sequence conforms to the physiological refractory period constraint of the motor unit and further improve the accuracy and physiological rationality of the firing sequence.

[0120] S160: Based on the degree of deviation between adjacent firing intervals and the physiological refractory period in the firing sequence, perform missing firing compensation and artifact removal on the firing sequence, and output the waveform template of each motor unit and the corrected firing sequence.

[0121] In this embodiment of the application, in order to eliminate the timing deviation caused by detection omissions and artifact interference, it is necessary to compensate and remove the firing sequence based on the physiological refractory period constraint in order to generate accurate firing timing data that conforms to the electrophysiological laws.

[0122] First, the firing sequence of each motion unit is traversed, and the interval between two adjacent firing moments in the firing sequence is calculated to obtain the adjacent firing interval. The adjacent firing interval reflects the discharge frequency and rhythm of the motion unit and serves as the basis for judging the completeness and rationality of the timing sequence.

[0123] Furthermore, the number of sampling points corresponding to adjacent firing intervals is compared with the number of adjacent firing points corresponding to the physiological refractory period, and corresponding correction operations are performed based on the degree of deviation. If the adjacent firing interval is greater than the compensation trigger multiple of the number of sampling points corresponding to the physiological refractory period, a compensation firing time is inserted between the two firing times at equal intervals to fill in the missing discharge events caused by detection omissions. If the adjacent firing interval is less than the number of sampling points corresponding to the physiological refractory period, the latter firing time is removed from the firing sequence to eliminate artifact discharges caused by noise or false detections.

[0124] Among them, the number of sampling points corresponding to the physiological refractory period is the sampling scale corresponding to the minimum recovery time after the motor unit cannot be excited again after discharge. The compensation trigger factor is calculated and set based on the ratio of the average interval of the firing sequence to the number of sampling points in the physiological refractory period. It is used to define the interval threshold for which missing compensation needs to be performed, so as to ensure that the correction operation is both in line with physiological laws and does not excessively interfere with the real rhythm.

[0125] Finally, the firing sequence after completing the missing firing compensation and artifact removal is used as the corrected firing sequence and associated with the waveform template of the corresponding motion unit for output.

[0126] This step, through timing correction under physiological constraints, effectively improves the accuracy and reliability of firing sequences, providing timing data for subsequent motor unit firing frequency analysis, muscle fatigue assessment, and movement pattern recognition.

[0127] Step S160 in the method provided in this application embodiment includes: Traverse the firing sequence of each motion unit, calculate the interval between two adjacent firing times in the firing sequence, and obtain the adjacent firing interval; Compare the number of sampling points corresponding to the adjacent firing interval with the physiological refractory period; If the adjacent firing interval is greater than the compensation trigger multiple of the number of sampling points corresponding to the physiological refractory period, then a compensation firing time is inserted between the two firing times according to the equal division of the adjacent firing interval. If the interval between adjacent firings is less than the number of sampling points corresponding to the physiological refractory period, then the next firing time will be removed from the firing sequence. The firing sequence after completing the missing firing compensation and artifact removal is used as the corrected firing sequence and associated with the waveform template of the motion unit for output.

[0128] Specifically, the firing sequence of each motion unit is first traversed, and the time interval between two adjacent firing times in the firing sequence is calculated one by one to obtain the adjacent firing interval.

[0129] Among them, the adjacent discharge interval is a parameter reflecting the discharge rhythm of the motion unit, corresponding to the time difference between two discharge events. Its rationality directly determines the accuracy of the discharge sequence. By calculating each group of adjacent intervals one by one, abnormal problems in the timing sequence can be comprehensively investigated.

[0130] Furthermore, the number of sampling points corresponding to the calculated adjacent firing intervals and the physiological refractory period are compared, and different correction operations are performed based on the comparison results. All operations are based on the electrophysiological laws of the motor unit to ensure that the corrected sequence conforms to the real discharge characteristics.

[0131] The number of sampling points corresponding to the physiological refractory period is determined based on the electromyographic signal sampling frequency and the physiological characteristics of the motor unit. When the conventional sampling frequency is 10kHz, the physiological refractory period corresponds to 20 to 50 sampling points, which corresponds to a physical time of 2ms to 5ms. This value is consistent with the minimum recovery time that must be passed after the skeletal muscle motor unit discharges, and is the core threshold for judging the rationality of the discharge sequence.

[0132] Specifically, if the interval between adjacent discharges is greater than the compensation trigger multiple of the number of sampling points corresponding to the physiological refractory period, it indicates that there is a missing discharge event within that interval. Compensation discharge times need to be inserted between the two discharge times according to the equal division of the adjacent discharge intervals to fill the detection omission.

[0133] In the method provided in this application embodiment, if the adjacent firing interval is greater than the compensation triggering multiple of the number of sampling points corresponding to the physiological refractory period, then a compensation firing time is inserted between the two firing times at equal intervals of the adjacent firing interval, including: Calculate the ratio of the number of sampling points corresponding to the adjacent firing interval to the number of physiological refractory periods, round the ratio down and subtract 1 to obtain the number of missing firings; The adjacent distribution interval is divided into the number of missing distributions plus a sub-interval of equal length, and the dividing point of the adjacent sub-interval is used as the dividing point. The length of the sub-interval is determined based on the adjacent distribution interval and the number of missing distributions. The time corresponding to each equally divided point is taken as the compensation release time, and is sequentially inserted between two release times, so that the interval between adjacent releases in the inserted release sequence is not greater than the compensation trigger multiple of the number of sampling points corresponding to the physiological refractory period. The compensation trigger multiple is determined based on the ratio of the average interval of the release sequence to the number of sampling points corresponding to the physiological refractory period.

[0134] Specifically, the ratio of the number of sampling points corresponding to the adjacent firing interval to the physiological refractory period is first calculated. This ratio directly reflects the number of firings that may be missing within the interval between two adjacent firings. By rounding down to remove invalid counts in the decimal part, and then subtracting 1, the number of missing firings is obtained. This calculation method can accurately quantify the actual missing firing events within the interval, avoiding overcompensation or undercompensation.

[0135] The compensation trigger factor is determined by rounding down the ratio of the average interval of the firing sequence to the number of sampling points corresponding to the physiological refractory period. The average interval of the firing sequence is obtained by taking the arithmetic mean of all adjacent firing intervals. This factor is used to define the interval threshold that needs to be compensated, so as to avoid ineffective compensation for normal intervals.

[0136] For example, the average interval of the firing sequence is 60 sampling points, and the physiological refractory period corresponds to 20 sampling points. The ratio of the two is 3. After rounding down, the compensation triggering multiple is 3. That is, when the interval between adjacent firings is greater than 60 sampling points (20×3), missing compensation is required.

[0137] Furthermore, after obtaining the number of missing distributions, the adjacent distribution intervals are divided into the number of missing distributions plus a sub-interval of equal length, with the dividing point between adjacent sub-intervals serving as the dividing point.

[0138] The length of the sub-interval is calculated by dividing the adjacent firing interval by the number of missing firings plus 1. This calculation method ensures that all compensation firing times are evenly distributed between two adjacent original firing times, which conforms to the rhythmic characteristics of uniform discharge of the moving unit and avoids timing deviations caused by uneven distribution of compensation times.

[0139] For example, the adjacent firing interval is 80 sampling points, and the physiological refractory period corresponds to 20 sampling points. The ratio of the two is 4. After rounding down and subtracting 1, the number of missing firings is 3. The length of the sub-interval is 80 / (3+1)=20 sampling points. The length of each sub-interval is consistent with the number of sampling points corresponding to the physiological refractory period, so as to ensure that the compensated adjacent firing intervals all meet the physiological constraints.

[0140] Meanwhile, the value of the sub-interval length must match the number of sampling points corresponding to the physiological refractory period. Usually, the sub-interval length is not greater than the compensation trigger multiple of the number of sampling points corresponding to the physiological refractory period, so as to ensure that after the compensation time is inserted, the adjacent firing intervals are within a reasonable range, which can both fill the missing discharge and not violate the physiological discharge law of the motor unit.

[0141] If the sub-interval length is too large, the adjacent intervals after compensation will still exceed the threshold, and the compensation effect will not be achieved; if the sub-interval length is too small, overcompensation will occur, introducing false discharges. Therefore, the sub-interval length must be strictly determined by calculating the adjacent discharge interval and the number of missing discharges to ensure its rationality and scientific validity.

[0142] Subsequently, the time corresponding to each equal division point is used as the compensation distribution time and inserted sequentially between two original distribution times. During the insertion process, the temporal continuity of the distribution sequence must be maintained to ensure that the arrangement order of the compensation time and the original distribution time conforms to the time axis pattern and that no temporal disorder occurs.

[0143] After the insertion is completed, the adjacent firing intervals after the insertion need to be verified to ensure that all adjacent intervals are not greater than the compensation trigger multiple of the number of sampling points corresponding to the physiological refractory period, so as to achieve accurate compensation for missing firings and make the firing sequence fully reflect the true discharge timing of the motor unit.

[0144] For example, in a firing sequence of a certain motor unit, two adjacent firing times are the 100th and 180th sampling points, respectively, and the interval between adjacent firings is 80 sampling points; the physiological refractory period corresponds to 20 sampling points, the average interval of the firing sequence is 60 sampling points, the compensation trigger factor is 60 / 20=3, which is rounded down to 3, and the compensation trigger factor for the number of sampling points corresponding to the physiological refractory period is 60 sampling points.

[0145] Since 80 sampling points is greater than 60 sampling points, missing data compensation is required. Specifically, the ratio of the number of adjacent firing intervals to the number of sampling points corresponding to the physiological refractory period is calculated as 80 / 20 = 4. After rounding down to 4, subtracting 1 gives the number of missing firings as 3. The interval of the 80 sampling points is divided into 3 + 1 = 4 sub-intervals, each with a length of 20 sampling points. The times corresponding to the division points are the 120th, 140th, and 160th sampling points, respectively. These three times are used as compensation firing times and are inserted sequentially between the 100th and 180th sampling points. After insertion, the adjacent firing intervals are all 20 sampling points, which is no greater than the 60 sampling points corresponding to the compensation trigger multiple, thus meeting the compensation requirements.

[0146] The compensation process determines the number of missing events and the location of compensation through quantitative calculations, avoiding errors caused by human experience and ensuring that the compensation operation not only conforms to the electrophysiological laws of the motion unit, but also fills the missing discharge events.

[0147] Furthermore, after completing all missing discharge compensation operations, it is necessary to simultaneously remove spurious discharges in the discharge sequence. That is, if the interval between adjacent discharges is less than the number of sampling points corresponding to the physiological refractory period, the next discharge moment will be removed from the discharge sequence.

[0148] The above steps are based on the electrophysiological characteristics of motor units. The physiological refractory period is the minimum recovery time that a motor unit must undergo after completing one discharge. During this period, the neuromuscular unit of the motor unit cannot be reactivated to produce an effective discharge. Therefore, the interval between two adjacent discharges must not be less than the number of sampling points corresponding to the physiological refractory period. If the interval is less than this threshold, it indicates that the subsequent discharge moment is not a real discharge event, but an artifact caused by noise interference, waveform detection misjudgment, and other factors during the electromyography signal acquisition process. It must be removed to eliminate the impact of artifacts on the accuracy of the discharge sequence.

[0149] In the actual removal operation, all adjacent firing intervals are traversed, and each interval is compared with the number of sampling points corresponding to the physiological refractory period. If an adjacent firing interval is detected to be less than the threshold, the next firing time corresponding to that interval is directly removed from the firing sequence, while the previous firing time is retained. This ensures that after artifact removal, the adjacent intervals of the remaining firing sequence are not less than the number of sampling points corresponding to the physiological refractory period, which fits the true firing rhythm of the motor unit.

[0150] It is important to note that the removal operation only applies to the next release time to avoid the loss of real discharge events due to accidental deletion. In addition, after removal, the release intervals adjacent to that position need to be recalculated and verified again to see if they meet the constraints, in order to prevent new interval anomalies caused by a single removal.

[0151] For example, the firing sequence of a certain motor unit before correction has [100, 115, 140, 150, 180] sampling points, the physiological refractory period corresponds to 20 sampling points, and traversing the adjacent firing intervals yields: 115-100=15 sampling points, 140-115=25 sampling points, 150-140=10 sampling points, and 180-150=30 sampling points.

[0152] Among them, 15 sampling points and 10 sampling points are both less than 20 sampling points, so they need to be removed at the next release time: First, remove 115 sampling points, and the sequence becomes [100, 140, 150, 180]; then check the new adjacent intervals 140-100=40 sampling points (meets the requirements), 150-140=10 sampling points (still does not meet the requirements), and continue to remove 150 sampling points, finally obtaining the sequence [100, 140, 180]. At this time, all adjacent intervals are 40 sampling points and 40 sampling points respectively, which are not less than 20 sampling points, and the artifact discharge is successfully removed.

[0153] After completing all missing discharge compensation and artifact removal operations, the processed discharge sequence is used as the corrected discharge sequence and associated with the waveform template of the corresponding motion unit. The waveform template is a characteristic identifier of the motion unit, containing core features such as the amplitude, waveform shape, and duration of the discharge waveform. Associating the corrected discharge sequence with the waveform template clearly identifies the motion unit at each discharge moment, achieving a one-to-one correspondence between waveform features and temporal patterns.

[0154] In addition, before correlating the output, the corrected firing sequence must be fully verified. This involves checking each adjacent firing interval to ensure it is not less than the number of sampling points corresponding to the physiological refractory period, whether there are any uncompensated missing discharges, and whether there are any residual artifact discharges. Simultaneously, the temporal continuity of the firing sequence must be verified to ensure there are no temporal discrepancies or repeated moments. If any anomalies are still found, the compensation or removal operation must be repeated until the firing sequence fully conforms to the electrophysiological laws of the motor unit.

[0155] Finally, by obtaining the waveform template of motor units through waveform clustering, and combining the missing sequence compensation and artifact removal, the accurate analysis of different motor unit firing patterns in electromyographic signals was achieved, thus providing scientific decomposition results for neuromuscular function assessment and rehabilitation applications.

[0156] The embodiments of this application, through the specific implementation methods described above, achieve the following technical effects: This application proposes an electromyography (EMG) signal decomposition method based on waveform intelligent clustering. First, the raw EMG signal acquired by an insertable electrode is obtained. After bandpass filtering, waveform detection, time alignment, and abnormal segment removal, a regular and uniform set of waveform segments is constructed. Then, a morphological spatial density field is constructed based on waveform morphological distance, and core points are adaptively determined according to sample size. Ordered clustering is used to complete reachability distance sorting and order reconstruction. Next, clusters are divided according to reachability distance boundaries to obtain waveform templates for each motor unit, and unclassifiable isolated segments are marked as superimposed segments. Subsequently, using the waveform templates as primitives and combining physiological refractory period constraints, a reconstruction error function is constructed, and the optimal primitive combination is solved to achieve superimposed segment decomposition. Afterward, the independent firing and superimposed decomposition results are merged to construct the original firing sequence for each motor unit. Finally, based on the deviation between the firing interval and physiological refractory period, missing firing compensation and artifact removal are performed on the sequence, outputting the final waveform template and corrected firing sequence.

[0157] The method provided in this application, through the technical solution of "signal preprocessing - density clustering - cluster partitioning - superposition decomposition - sequence construction - temporal correction", solves the problem that the traditional surface electromyography method relies solely on subjective human interpretation, resulting in rough results. At the same time, it overcomes the defects such as the difficulty in splitting superimposed waveforms, the lack of temporal information, and artifact interference. It can accurately restore the discharge characteristics of a single motor unit, providing technical support for neuromuscular function assessment and rehabilitation monitoring.

[0158] Example 2, as shown in the appendix Figure 2 As shown, based on the inventive concept of an electromyography (EMG) signal decomposition method based on waveform intelligent clustering provided in Embodiment 1, this application also provides an EMG signal decomposition system based on waveform intelligent clustering, specifically including: Waveform acquisition and construction module 01 is used to acquire the raw electromyographic signals acquired by the insertable electrodes, perform waveform detection and alignment on the raw electromyographic signals, and construct a set of waveform segments; The density clustering and sorting module 02 is used to construct the density field of the waveform segment set in the shape space based on the similarity of waveform shape, and to sort and reconstruct the order of the waveform segment set by reachability distance through an ordered clustering algorithm to obtain the reachability distance sorted sequence. Cluster generation module 03 is used to divide the reachability distance sorting sequence into clusters and mark waveform segments that are not assigned to any cluster as superimposed segments, wherein each cluster corresponds to a waveform template of a motion unit; The superimposed waveform decomposition module 04 is used to construct a reconstruction error function for each superimposed segment using the waveform template as the basic element, and to solve for the basic element combination that minimizes the reconstruction error and satisfies the physiological refractory period constraint of the motion unit, which is used as the decomposition result of the corresponding superimposed segment. The firing sequence construction module 05 is used to merge the waveform template and firing time corresponding to the cluster with the primitives and occurrence positions obtained by decomposing the superimposed segment to construct the firing sequence of each motion unit. The sequence correction output module 06 is used to perform missing firing compensation and artifact removal on the firing sequence based on the degree of deviation between the adjacent firing intervals and the physiological refractory period in the firing sequence, and output the waveform template of each motion unit and the corrected firing sequence.

[0159] In one embodiment, the waveform acquisition and construction module 01 is further configured to: preprocess the original electromyography (EMG) signal based on bandpass filtering to obtain the filtered original EMG signal; calculate the median absolute deviation based on the amplitude distribution of the filtered original EMG signal; use a fixed multiple of the median absolute deviation as a detection threshold to extract waveform intervals from the filtered original EMG signal whose amplitudes continuously exceed the detection threshold as candidate waveforms; for each candidate waveform, use the maximum amplitude point within the waveform interval as an alignment reference to translate multiple candidate waveforms on the time axis until they coincide with the alignment reference, thereby obtaining aligned waveform segments; calculate the morphological distance between each pair of aligned waveform segments, remove waveform segments whose morphological distance is greater than the upper limit threshold based on the interquartile range, and include the remaining waveform segments in the waveform segment set.

[0160] In one embodiment, the density clustering sorting module 02 is further configured to: use the morphological distance between each pair of waveform segments as a similarity measure, define two waveform segments whose morphological distance is less than the neighborhood radius as adjacent to each other, wherein the neighborhood radius is taken as a lower limit threshold based on the interquartile range; count the number of adjacent waveform segments in the morphological space for each waveform segment as the density value of the waveform segment, and construct the density field according to the density value distribution of all waveform segments; determine the minimum number of core points according to the sample size of the waveform segment set, and mark the waveform segments with a density value greater than or equal to the minimum number of core points as core points; starting from any core point, iteratively expand according to the principle of minimum reachability priority, sequentially visit waveform segments and record reachability distances, and generate an ordered sequence and a corresponding reachability distance sequence as the reachability distance sorting sequence.

[0161] Furthermore, the density clustering ranking module 02 also includes: obtaining the total number of waveform segments in the waveform segment set as the sample size; calculating the logarithm of the sample size to the base 2, rounding the logarithm down to obtain a baseline value; if the baseline value is less than the minimum lower limit, then taking the minimum number of core points as the minimum lower limit, wherein the minimum lower limit is determined as a first constant based on the minimum sample size required to form a meaningful cluster; if the baseline value is greater than the maximum upper limit, then taking the minimum number of core points as the maximum upper limit, wherein the maximum upper limit is determined as a second constant based on the ratio of the sample size of the waveform segment set to the neighborhood radius, and the second constant is not less than the first constant; otherwise, taking the minimum number of core points as the baseline value.

[0162] Furthermore, the density clustering sorting module 02 also includes: taking any unvisited core point as the current starting point, marking the current starting point as visited, and adding it to the ordered sequence, while simultaneously recording the reachability distance of the current starting point as zero; collecting all unvisited adjacent waveform segments of the current starting point, calculating the reachability distance of each adjacent waveform segment relative to the current starting point; using the calculated reachability distance as the current reachability distance of the corresponding adjacent waveform segment in the seed queue, wherein the seed queue is a set used to store waveform segments to be visited and their current reachability distances, and the current reachability distance is dynamically updated during the iteration process; selecting the waveform segment with the smallest current reachability distance from the seed queue as the next visit point, marking the next visit point as visited, and adding it to the ordered sequence; and synchronously recording the reachability distance of the current starting point as zero. The system first generates an ordered sequence and records the reachable distance of the next access point. If the next access point is a core point, it collects all unvisited adjacent waveform segments of the next access point and calculates the reachable distance of each adjacent waveform segment relative to the next access point. If the calculated reachable distance is less than the current reachable distance of the adjacent waveform segment in the seed queue, it updates the reachable distance in the seed queue. The system then repeatedly selects the waveform segment with the smallest reachable distance from the seed queue as the next access point and performs the corresponding update operation until the seed queue is empty. If there are unvisited waveform segments, it selects the unvisited core point as the new current starting point and repeats the expansion and update process until all waveform segments are visited, outputting an ordered sequence and the corresponding reachable distance sequence.

[0163] In one embodiment, the superimposed waveform decomposition module 04 is further configured to: determine the time window range of the superimposed segment on the time axis; discretize and generate a set of candidate occurrence positions for each waveform template within the time window range, using the length of the waveform template as the step size; introduce a physiological refractory period constraint for the motion unit, wherein the physiological refractory period constraint limits the same waveform template to appear at most once within the superimposed segment, and the interval between the occurrence positions of any two waveform templates is not less than the number of sampling points corresponding to the physiological refractory period; under the condition of satisfying the physiological refractory period constraint, enumerate all feasible solutions for the primitive combination in the candidate occurrence position set; for each enumerated feasible primitive combination, construct the residual sum of squares between the superimposed segment and the weighted superimposed result of all waveform templates, using the amplitude scaling factor of each waveform template in the feasible primitive combination at the corresponding candidate occurrence position as the variable, as the reconstruction error function; solve for the amplitude scaling factor that minimizes the reconstruction error function, and calculate the corresponding reconstruction error based on the solved amplitude scaling factor; select the primitive combination with the smallest reconstruction error as the decomposition result of the superimposed segment.

[0164] Furthermore, the superimposed waveform decomposition module 04 also includes: defining a time window range by the start and end sampling points of the superimposed segment on the time axis, wherein the time axis is the time sampling axis of the original electromyographic signal; generating candidate occurrence positions for each waveform template within the time window range according to the number of sampling points corresponding to the physiological refractory period, with the length of the waveform template as the step size, such that the interval between any two candidate occurrence positions is not less than the number of sampling points corresponding to the physiological refractory period; arranging the generated candidate occurrence positions in chronological order to form a set of candidate occurrence positions for each waveform template.

[0165] In one embodiment, the sequence correction output module 06 is further configured to: traverse the firing sequence of each motion unit, calculate the interval between two adjacent firing moments in the firing sequence, and obtain the adjacent firing interval; compare the adjacent firing interval with the number of sampling points corresponding to the physiological refractory period; if the adjacent firing interval is greater than the compensation trigger multiple of the number of sampling points corresponding to the physiological refractory period, then insert a compensation firing moment between the two firing moments according to the equal division position of the adjacent firing interval; if the adjacent firing interval is less than the number of sampling points corresponding to the physiological refractory period, then remove the latter firing moment from the firing sequence; and output the firing sequence after completing the missing firing compensation and artifact removal as the corrected firing sequence, associated with the waveform template of the motion unit.

[0166] Furthermore, the sequence correction output module 06 also includes: calculating the ratio of the number of sampling points corresponding to the adjacent firing interval to the number of sampling points corresponding to the physiological refractory period, rounding the ratio down and subtracting 1 to obtain the number of missing firings; dividing the adjacent firing interval into the number of missing firings plus a sub-interval of equal length, with the boundary point of the adjacent sub-interval as the division point, wherein the length of the sub-interval is determined based on the adjacent firing interval and the number of missing firings; taking the time corresponding to each division point as the compensation firing time, and inserting it sequentially between two firing times, so that the adjacent firing intervals in the inserted firing sequence are not greater than the compensation triggering multiple of the number of sampling points corresponding to the physiological refractory period, wherein the compensation triggering multiple is determined based on the ratio of the average interval of the firing sequence to the number of sampling points corresponding to the physiological refractory period.

Claims

1. A method for decomposing electromyographic signals based on waveform intelligent clustering, characterized in that, The method includes: The raw electromyographic signals acquired by the insertable electrodes are obtained, and the raw electromyographic signals are subjected to waveform detection and alignment to construct a set of waveform segments; Based on the similarity of waveform morphology, a density field of the waveform segment set in morphological space is constructed. The waveform segment set is then sorted by reachability distance and its order is reconstructed using an ordered clustering algorithm to obtain a reachability distance sorted sequence. The reachability distance sorting sequence is divided into clusters, and waveform segments that are not assigned to any cluster are marked as superimposed segments. The clusters are divided by using the positions in the reachability distance sorting sequence where the reachability distance is greater than the neighborhood radius as the cluster boundaries, and each cluster corresponds to a waveform template of a motion unit. For each superimposed segment, the reconstruction error function of the superimposed segment is constructed using the waveform template as the basic unit. Combined with the physiological refractory period constraint of the motion unit, the basic unit combination that minimizes the reconstruction error and satisfies the physiological refractory period constraint is solved as the decomposition result of the corresponding superimposed segment. The physiological refractory period constraint limits the same waveform template to appear at most once in the superimposed segment, and the interval between the appearance positions of any two waveform templates is not less than the number of sampling points corresponding to the physiological refractory period. The waveform templates and firing times corresponding to the clusters are merged with the primitives and their occurrence positions obtained from the decomposition of the superimposed segments to construct the firing sequence for each motion unit. Based on the degree of deviation between adjacent firing intervals and the physiological refractory period in the firing sequence, missing firing compensation and artifact removal are performed on the firing sequence, and waveform templates and corrected firing sequences for each motor unit are output.

2. The electromyographic signal decomposition method based on waveform intelligent clustering according to claim 1, characterized in that, The raw electromyographic (EMG) signals acquired by the insertable electrodes are obtained, and waveform detection and alignment are performed on the raw EMG signals to construct a set of waveform segments, including: The original electromyography (EMG) signal is preprocessed based on bandpass filtering to obtain the filtered original EMG signal. Calculate the absolute deviation of the median based on the amplitude distribution of the original electromyographic signal after filtering; Using a fixed multiple of the absolute deviation of the median as the detection threshold, waveform intervals whose amplitudes continuously exceed the detection threshold are extracted from the filtered original electromyography signal as candidate waveforms. For each candidate waveform, the point with the largest amplitude within the waveform interval is used as the alignment reference. Multiple candidate waveforms are translated on the time axis to coincide with the alignment reference to obtain the aligned waveform segment. Calculate the morphological distance between each pair of aligned waveform segments, remove waveform segments whose morphological distance is greater than the upper limit threshold based on the interquartile range, and add the remaining waveform segments to the waveform segment set.

3. The electromyographic signal decomposition method based on waveform intelligent clustering according to claim 1, characterized in that, Based on the similarity of waveform morphology, a density field is constructed in the morphology space of the waveform segment set. An ordered clustering algorithm is then used to sort and reconstruct the order of the waveform segment set by reachability distance, resulting in a reachability distance sorted sequence, including: The morphological distance between any two waveform segments is used as a similarity measure. Two waveform segments with a morphological distance less than the neighborhood radius are defined as adjacent to each other. The neighborhood radius is taken as a lower limit threshold based on the interquartile range. The number of adjacent waveform segments in the morphological space for each waveform segment is counted and used as the density value of the waveform segment. The density field is constructed based on the density value distribution of all waveform segments. The minimum number of core points is determined based on the sample size of the waveform segment set, and waveform segments with a density value greater than or equal to the minimum number of core points are marked as core points. Starting from any core point, the system iteratively expands according to the principle of prioritizing the minimum reachable distance, sequentially accessing waveform segments and recording reachable distances to generate an ordered sequence and a corresponding reachable distance sequence, which serve as the reachable distance sorting sequence.

4. The electromyographic signal decomposition method based on waveform intelligent clustering according to claim 3, characterized in that, The minimum number of core points is determined based on the sample size of the waveform segment set, including: Obtain the total number of waveform segments in the waveform segment set, and use this as the sample size; Calculate the base-2 logarithm of the sample size, and round the logarithm down to obtain the baseline value; If the benchmark value is less than the minimum lower limit, then the minimum number of core points is taken as the minimum lower limit. The minimum lower limit is determined as a first constant based on the minimum sample size required to form a meaningful cluster. The meaningful cluster requires at least 3 samples to support it. If the benchmark value is greater than the maximum upper limit value, then the minimum number of core points is taken as the maximum upper limit value. The maximum upper limit value is determined as a second constant based on the ratio of the sample size of the waveform segment set to the neighborhood radius, and the second constant is not less than the first constant. Otherwise, the minimum number of core points shall be taken as the baseline value.

5. The electromyographic signal decomposition method based on waveform intelligent clustering according to claim 3, characterized in that, Starting from any core point, the system iteratively expands according to the principle of prioritizing the minimum reachable distance, sequentially visiting waveform segments and recording their reachable distances, generating an ordered sequence and a corresponding reachable distance sequence, which serves as the reachable distance sorting sequence, including: Take any unvisited core point as the current starting point, mark the current starting point as visited, add it to the ordered sequence, and simultaneously record the reachability distance of the current starting point as zero; Collect all unvisited adjacent waveform segments from the current starting point, and calculate the reachability distance of each adjacent waveform segment relative to the current starting point; The calculated reachable distance is used as the current reachable distance of the corresponding adjacent waveform segment in the seed queue, wherein the seed queue is a set used to store the waveform segments to be visited and their current reachable distances, and the current reachable distance is dynamically updated during the iteration process; Select the waveform segment with the smallest reachable distance from the seed queue as the next access point, mark the next access point as visited, add it to the ordered sequence, and record the reachable distance of the next access point; If the next access point is a core point, then collect all unvisited adjacent waveform segments of the next access point and calculate the reachability distance of each adjacent waveform segment relative to the next access point. If the calculated reachable distance is less than the current reachable distance of the adjacent waveform segment in the seed queue, then update the reachable distance in the seed queue; Repeatedly select the waveform segment with the smallest reachable distance from the seed queue as the next access point and perform the corresponding update operation until the seed queue is empty; If there are unvisited waveform segments, select the unvisited core point as the new current starting point, repeat the expansion and update process until all waveform segments are visited, and output an ordered sequence and the corresponding reachable distance sequence.

6. The electromyographic signal decomposition method based on waveform intelligent clustering according to claim 1, characterized in that, For each superimposed segment, using the waveform template as a primitive, a reconstruction error function for the superimposed segment is constructed. Combined with the physiological refractory period constraint of the motion unit, the primitive combination that minimizes the reconstruction error and satisfies the physiological refractory period constraint is solved as the decomposition result of the corresponding superimposed segment, including: Determine the time window range of the superimposed segment on the time axis, and discretize the candidate occurrence position set of each waveform template within the time window range using the length of the waveform template as the step size; A physiological refractory period constraint for motion units is introduced, wherein the physiological refractory period constraint limits the same waveform template to appear at most once within the superimposed segment, and the interval between the appearance positions of any two waveform templates is not less than the number of sampling points corresponding to the physiological refractory period; Under the condition of satisfying the physiological refractory period constraint, enumerate all feasible solutions for the combination of primitives in the candidate occurrence position set; For each enumerated feasible primitive combination, the amplitude scaling factor of each waveform template in the feasible primitive combination at the corresponding candidate occurrence position is used as a variable to construct the residual sum of squares between the superimposed segment and the weighted superimposed result of all waveform templates, which is used as the reconstruction error function. Solve for the amplitude scaling factor that minimizes the reconstruction error function, and calculate the corresponding reconstruction error based on the obtained amplitude scaling factor; The combination of primitives with the smallest reconstruction error is selected as the decomposition result of the superimposed segment.

7. The electromyographic signal decomposition method based on waveform intelligent clustering according to claim 6, characterized in that, Determine the time window range of the superimposed segment on the time axis, and discretize the candidate occurrence position set of each waveform template within the time window range, using the length of the waveform template as the step size. This includes: The time window range is defined by the start and end sampling points of the superimposed segments on the time axis, wherein the time axis is the time sampling axis of the original electromyographic signal; Using the length of the waveform template as the step size, within the time window, according to the number of sampling points corresponding to the physiological refractory period, candidate occurrence positions are generated for each waveform template, such that the interval between any two candidate occurrence positions is not less than the number of sampling points corresponding to the physiological refractory period. The generated candidate occurrence positions are arranged in chronological order to form a set of candidate occurrence positions for each waveform template.

8. The electromyographic signal decomposition method based on waveform intelligent clustering according to claim 1, characterized in that, Based on the degree of deviation between adjacent firing intervals and the physiological refractory period in the firing sequence, missing firing compensation and artifact removal are performed on the firing sequence, and the waveform templates of each motor unit and the corrected firing sequence are output, including: Traverse the firing sequence of each motion unit, calculate the interval between two adjacent firing times in the firing sequence, and obtain the adjacent firing interval; Compare the number of sampling points corresponding to the adjacent firing interval with the physiological refractory period; If the adjacent firing interval is greater than the compensation trigger multiple of the number of sampling points corresponding to the physiological refractory period, then a compensation firing time is inserted between the two firing times according to the equal division of the adjacent firing interval. If the interval between adjacent firings is less than the number of sampling points corresponding to the physiological refractory period, then the next firing time will be removed from the firing sequence. The firing sequence after completing the missing firing compensation and artifact removal is used as the corrected firing sequence and associated with the waveform template of the motion unit for output.

9. The electromyographic signal decomposition method based on waveform intelligent clustering according to claim 8, characterized in that, If the adjacent firing interval is greater than the compensation trigger multiple of the number of sampling points corresponding to the physiological refractory period, then a compensation firing time is inserted between the two firing times at equal intervals of the adjacent firing interval, including: Calculate the ratio of the number of sampling points corresponding to the adjacent firing interval to the number of physiological refractory periods, round the ratio down and subtract 1 to obtain the number of missing firings; The adjacent distribution interval is divided into the number of missing distributions plus a sub-interval of equal length, and the dividing point of the adjacent sub-interval is used as the dividing point. The length of the sub-interval is determined based on the adjacent distribution interval and the number of missing distributions. The time corresponding to each equally divided point is taken as the compensation release time, and is sequentially inserted between two release times, so that the interval between adjacent releases in the inserted release sequence is not greater than the compensation trigger multiple of the number of sampling points corresponding to the physiological refractory period. The compensation trigger multiple is determined based on the ratio of the average interval of the release sequence to the number of sampling points corresponding to the physiological refractory period.

10. A system for decomposing electromyographic signals based on waveform intelligent clustering, characterized in that, The system is used to execute the electromyographic signal decomposition method based on waveform intelligent clustering as described in any one of claims 1-9, and the system comprises: The waveform acquisition and construction module is used to acquire the raw electromyographic signals acquired by the insertable electrodes, perform waveform detection and alignment on the raw electromyographic signals, and construct a set of waveform segments. The density clustering and sorting module is used to construct the density field of the waveform segment set in the shape space based on the similarity of waveform shape, and to sort and reconstruct the order of the waveform segment set by reachability distance through an ordered clustering algorithm to obtain the reachability distance sorted sequence. The cluster generation module is used to divide the reachability distance sorting sequence into clusters and mark waveform segments that are not assigned to any cluster as superimposed segments. The clusters are divided by using the positions in the reachability distance sorting sequence where the reachability distance is greater than the neighborhood radius as the cluster boundaries, and each cluster corresponds to a waveform template of a motion unit. The superimposed waveform decomposition module is used to construct a reconstruction error function for each superimposed segment using the waveform template as the basic unit, and to solve for the basic unit combination that minimizes the reconstruction error and satisfies the physiological refractory period constraint of the motion unit, which is used as the decomposition result of the corresponding superimposed segment. The physiological refractory period constraint limits the same waveform template to appear at most once in the superimposed segment, and the interval between the appearance positions of any two waveform templates is not less than the number of sampling points corresponding to the physiological refractory period. The firing sequence construction module is used to merge the waveform template and firing time corresponding to the cluster with the primitives and occurrence positions obtained from the decomposition of the superimposed segment to construct the firing sequence of each motion unit; The sequence correction output module is used to compensate for missing firings and remove artifacts in the firing sequence based on the degree of deviation between adjacent firing intervals and the physiological refractory period, and output the waveform template of each motor unit and the corrected firing sequence.

Citation Information

Patent Citations

  • Hand action identification method based on surface electromyography decomposition

    CN104899594A

  • Devices, systems, and methods for diagnosing treating and monitoring chronic pelvic pain

    US20230053296A1