A method for extracting m-wave based on adaptive threshold
By automatically segmenting and extracting M-waves using an adaptive thresholding method and the FastICA algorithm, the problem of complex threshold adjustment in existing technologies is solved, and efficient M-wave extraction under different conditions is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNIV OF SCI & TECH OF CHINA
- Filing Date
- 2024-06-24
- Publication Date
- 2026-05-12
AI Technical Summary
Existing M-wave extraction methods require frequent threshold adjustments to address electrical stimulation artifacts and noise under different conditions, and manual adjustments are required in clinical analysis, making the process complex and time-consuming.
An adaptive thresholding method was adopted, which sets the threshold by calculating the mean, standard deviation and quantile of the electromyographic signal. Combined with the FastICA algorithm, electrical stimulation artifacts were removed, stimulation time periods were automatically segmented and M waves were extracted.
It enables automatic extraction of M-waves under different subjects and conditions, reducing the need for manual parameter adjustment, improving operational efficiency and accuracy, and reducing noise interference.
Smart Images

Figure CN118484634B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of biomedical signal processing, specifically relating to an M-wave extraction method based on adaptive thresholding. Background Technology
[0002] Functional electrical stimulation (FES) falls under the category of neuromuscular electrical stimulation (NES). It uses low-frequency (1~100Hz) pulsed current of a certain intensity to stimulate one or more muscle groups through a pre-set program, inducing muscle movement or simulating normal voluntary movement, in order to improve or restore the function of the stimulated muscles or muscle groups.
[0003] Electromyography (EMG) signals are bioelectrical signals recorded by electrodes when nerve impulses are transmitted to muscles, causing muscle contraction. They carry neuromuscular control information and can reflect muscle activation to some extent. M-waves are a special type of EMG signal generated by directly inducing muscle contraction through electrical stimulation of motor nerves. They have specific morphology and characteristics and can be used to measure the response of stimulated muscles to electrical stimulation, the degree of local fatigue, and the nervous system's control over the muscle. They are one of the most commonly used methods for studying changes in fascial excitability.
[0004] Analyzing the M-waves generated by functional electrical stimulation (fEMG) is a crucial method for studying the effects of FEMG. Current research on M-waves primarily relies on the difference in amplitude between the electrical stimulation signal and ordinary electromyography (EMG) signals. This is achieved by using a fixed threshold segmentation method to extract the signal during stimulation periods, and then further segmenting the signal based on the difference in amplitude between the electrical stimulation signal and the M-wave within those periods; or by using an energy window method to segment the signal based on the difference in energy between the stimulation signal and the M-wave. However, due to variations in muscle location, stimulation frequency, signal noise levels, individual conditions, and the influence of stimulation artifacts, M-wave extraction often requires manual adjustment of the threshold, determination of the extraction interval length, and the start and end points of each extraction interval. In clinical analysis, manual screening by experienced physicians is even more necessary. Summary of the Invention
[0005] To overcome the limitations of existing M-wave extraction methods, this invention proposes an adaptive threshold-based M-wave extraction method. Unlike fixed-threshold-based methods, which require frequent threshold adjustments to remove electrical stimulation artifacts and extract M-waves under different conditions, this invention can adaptively extract M-waves under various conditions, including different subjects, stimulation frequencies, stimulation current intensities, and the presence of sudden impulse noise. The M-wave extraction algorithm provided by this invention can remove the influence of electrical stimulation impulse artifacts and reduce the time required for manually adjusting thresholds, determining extraction intervals, and defining the start and end points of M-waves, thus lowering the computational burden of the algorithm.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] An M-wave extraction method based on adaptive thresholding, the method comprising the following steps:
[0008] Step S1: Based on the mean, standard deviation, and quantile of the electromyographic signal of the M wave to be extracted, adaptively set the amplitude threshold of the stimulation period. Based on the threshold and signal gradient, obtain the pulse coordinate sequence. Calculate the pulse width sequence based on the pulse coordinate sequence. Perform noise reduction on the pulse width sequence and segment the stimulation period and non-stimulation period according to the distance between pulses.
[0009] Step S2: Based on the maximum and minimum values of the stimulus period signal, adaptively set the pulse amplitude threshold, locate the stimulus pulse waveform of the stimulus period signal, filter the stimulus period signal, and remove electrical stimulation artifacts;
[0010] Step S3: Based on the stimulation pulse waveform after removing electrical stimulation artifacts and the denoised pulse width sequence, determine the start and end points of the M-wave to extract the M-wave.
[0011] Furthermore, step 1 includes:
[0012] Step 1.1: Calculate the mean, standard deviation, quantiles, and signal gradient of the electromyographic signal of the M-wave to be extracted, and adaptively set the amplitude threshold of the stimulation period based on the above parameters to determine the coordinates of the stimulation point and obtain the start and end point coordinate sequence of each pulse.
[0013] Step 1.2: Adaptively set the pulse width threshold to remove short-duration burst pulse noise;
[0014] Step 1.3: Adaptively set the pulse distance threshold to achieve segmentation of the stimulation period and the non-stimulation period.
[0015] Furthermore, step 2 includes:
[0016] Step 2.1: Adaptively set the pulse amplitude threshold to determine the coordinate sequence of the highest and lowest points of the stimulation pulse waveform during the stimulation period;
[0017] Step 2.2: Remove electrical stimulation pulse artifacts from the stimulation period signal using the FastICA algorithm.
[0018] Furthermore, step 3 includes: extracting the M-wave based on the coordinate sequence of the highest and lowest points of the located stimulation pulse waveform and the pulse width.
[0019] The beneficial effects of this invention are as follows:
[0020] The M-wave extraction method proposed in this invention is highly operable; the proposed method does not require manual adjustment of a large number of algorithm parameters for each different signal, and can separate the signal from the noise and complete the extraction of the M-wave signal through adaptive adjustment of the threshold. Attached Figure Description
[0021] Figure 1 This is a flowchart of an M-wave extraction method based on adaptive thresholding.
[0022] Figure 2 This is a schematic diagram of electromyographic signals and amplitude thresholds during stimulation periods in an embodiment of the present invention;
[0023] Figure 3 This is a schematic diagram of a sudden noise and an electrical stimulation pulse waveform;
[0024] Figure 4 A schematic diagram showing the stimulus period signal and pulse amplitude threshold;
[0025] Figure 5 This is the signal during the stimulation period before artifact removal;
[0026] Figure 6 This is a signal during the pre-artifact stimulation period;
[0027] Figure 7 This is a schematic diagram of the M-wave extracted based on the method of this invention. Detailed Implementation
[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0029] This invention requires data containing a sufficient number of M-wave signals to verify the method's performance. Therefore, a self-built database was used to fulfill this requirement, containing 30 multi-channel electromyography (EMG) signal data segments containing M-waves. Figure 2 For example, each electromyography (EMG) data point includes the stimulation period, the non-stimulation period, the M-wave, and possible sudden noise.
[0030] An M-wave extraction method based on adaptive thresholding processes an entire segment of single or multi-channel electromyography (EMG) signal data at a time, with the following workflow: Figure 1 As shown, the specific steps are as follows:
[0031] Step 1: Stimulus and non-stimulus time segmentation method based on adaptive threshold.
[0032] Step 1.1: Calculate the length of the M-wave to be extracted. electromyographic signals The mean, standard deviation, quantile, and signal gradient are obtained, and thresholds are adaptively set based on each parameter to determine the coordinates of the stimulation point and obtain the pulse start and end point coordinate sequence.
[0033] Step 1.1.1: Calculate the mean. Standard deviation is and electromyographic signals Arrange the amplitudes from largest to smallest, and take the value at the 3rd percentile as the quantile value. ;
[0034] Step 1.1.2: Set the first threshold for the amplitude of the stimulus period. The second threshold for the amplitude of the stimulation period The first adaptive parameter is randomly initialized upon first execution of this step. Initialization in this embodiment Post-threshold , Size Figure 2 As shown.
[0035] Step 1.1.3: Record electromyographic signals The value in and The x-coordinate of the middle signal point gives a length of Initial stimulus pulse coordinate sequence s= [ s 1 , s 2 ,…, s L2 ] ,sequence Each element in represents a The value in and The x-coordinate of the intermediate signal point. Based on a pre-set threshold for the proportion of stimulation periods. ,like , indicating threshold If it is too small, then set And return to step 1.1.2 until... In this embodiment, Take 0.6.
[0036] Step 1.1.4: Obtain the electromyographic signal according to formula (1). differential signal According to formula (2), the length is... Pulse start and end point coordinate sequence l= [ l 1 , l 2 ,…, l N ] In formula (2) , , For index, sequence Points with odd-numbered subscripts are the starting point coordinates, and points with even-numbered subscripts are the ending point coordinates.
[0037] (1)
[0038] (2)
[0039] Step 1.2: Adaptively set the pulse width threshold to remove short-duration burst pulse noise;
[0040] Step 1.2.1: Calculate the length according to formula (3). Pulse width sequence w= [ w 1 , w 2 ,…, w N / 2 ] , Each element in the equation represents the width of a pulse, where, in formula (3) Use this as the index. And calculate the average value of the pulse width sequence. Because pulse and burst noise widths have such... Figure 3 The width difference shown is therefore determined based on a pre-set pulse width threshold. , pulse width less than The pulse is considered noise, and the corresponding noise pulse is discarded. Values and sequences The corresponding , The updated pulse start and end point coordinate sequence is obtained by taking the values of these values. and pulse width sequence .in, The length is , The length is In this embodiment Take 0.05.
[0041] (3)
[0042] Step 1.2.2: Calculate the updated pulse width sequence average Based on pre-set change thresholds ,like This indicates that the average value changed too much before and after noise removal, suggesting that some pulse signals were removed during denoising. Assign to Return to step 1.2.1 until... In this embodiment, Take 0.99.
[0043] Step 1.3: Adaptively set the pulse distance threshold to achieve segmentation of the stimulation period and the non-stimulation period.
[0044] Step 1.3.1: Calculate the adjacent pulse distance sequence according to formula (4). , Each element in the equation represents the distance between adjacent pulses, where, in formula (4) Use indexes. Calculate the distance sequence between adjacent pulses. mean Standard deviation And randomly initialize the second adaptive parameter. :
[0045] (4)
[0046] Step 1.3.2: Calculate the pulse distance threshold ;
[0047] Step 1.3.3: Calculate the length according to formula (5). Stimulus time segmentation sequence se= [ se (1), se (2),…, se (L4)] In formula (5) , Both represent indices. Sequence Each element in the table represents the x-coordinate of a segmentation point during a stimulus period, based on a pre-set threshold for the number of segments. ,like This indicates that the pulse distance threshold is too small. Assign to Return to step 1.3.2 and execute sequentially until... .like This indicates that the pulse distance threshold is too large, then... Assign to Return to step 1.3.2 and execute sequentially until... In this embodiment, Take 0.01.
[0048] (5)
[0049] Step 1.3.4: Using the stimulus time segmentation sequence and the updated pulse start and end point coordinate sequence and The connection between them Stimulus time segmentation, in which, This indicates the starting point of the last pulse in each stimulation period, except for the last stimulation period. This indicates the starting point of the first pulse in each stimulation period except the first stimulation period. It is determined according to equation (6). Get included Stimulation time group of each element J = [ j 1 t , j 2 t ,… …,j L4+1 (t)] T In this embodiment, the extracted stimulation period Signals such as Figure 4 As shown:
[0050] (6)
[0051] in, Indicates an index. express The last number in the sequence. To ensure the integrity of the pulse waveform, an extra segment was extracted at the beginning and end of the stimulation period. The length.
[0052] Step 2, Stimulation Pulse Localization Method During Stimulation Periods; for stimulation period groups Each stimulation period in Perform steps 2 and 3, where step 2 includes:
[0053] Step 2.1.1: Calculate the pulse amplitude threshold , ,in , The third and fourth adaptive adjustable parameters are initialized to 0.99. This embodiment initializes... , Post-threshold , Size Figure 4 As shown.
[0054] Step 2.1.2, Record At two thresholds , The coordinates of points other than those in the above range are greater than The coordinate sequence is denoted as Less than The coordinate sequence is denoted as .remember Length is , Length is .like Then let Return to step 2.1.1 and execute again. If Then let Return to step 2.1.1 and execute again. When This indicates that the highest and lowest points of all stimulation pulses have been located.
[0055] Step 2.1.3: Remove stimulus periods using the FastICA algorithm. The influence of electrical stimulation pulse artifacts was observed, resulting in a denoised product. The artifact removal effect is as follows: Figure 5 As shown in Figure 6, Figure 5 Indicates the signal before artifact removal. Figure 6 This indicates the capture of the artifact signal.
[0056] Step 3: M-wave extraction method.
[0057] Based on the coordinate sequence in step 2.1.2 and ,right The M-wave signal is extracted. Since the distance from the pulse's extreme point to its end is 0.5... Or 1.5 Therefore, according to equation (7) or equation (8) in Extract the M-wave to obtain the M-wave group. M n = [ m 1 t , m 2 t ,…, m L5 (t)] T , in formula (7), (8), Indicates the index. Extracted Signals such as Figure 7 As shown.
[0058] when hour,
[0059] (7)
[0060] when hour,
[0061] (8)
[0062] Stimulation period group After all the stimulation time period signals have completed steps 2 and 3, the M-wave signal to be extracted is obtained. Mwave= [ M 1 , M 2 ,…, M L4+1 ] T The superscript T indicates the transpose of the matrix.
[0063] After extracting the M-wave from one electromyographic signal in the database, the M-waves of all other electromyographic signals in the database are extracted sequentially.
[0064] Through the above description of the embodiments, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions of the above embodiments can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, mobile hard drive, etc.), including several instructions to cause a computer device (such as a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0065] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An M-wave extraction method based on adaptive thresholding, characterized in that, The method includes the following steps: Step S1: Based on the mean, standard deviation, and quantile of the electromyographic signal of the M wave to be extracted, adaptively set the amplitude threshold of the stimulation period. Based on the threshold and signal gradient, obtain the pulse coordinate sequence. Calculate the pulse width sequence based on the pulse coordinate sequence. Perform noise reduction on the pulse width sequence and segment the stimulation period and non-stimulation period according to the distance between pulses. Step S2: Based on the maximum and minimum values of the stimulus period signal, adaptively set the pulse amplitude threshold, locate the stimulus pulse waveform of the stimulus period signal, filter the stimulus period signal, and remove electrical stimulation artifacts; Step S3: Based on the highest and lowest point coordinate sequences of the stimulation pulse waveform of the located stimulation period signal, and the denoised pulse width sequence, determine the start and end points of the M-wave in the stimulation period signal after removing electrical stimulation artifacts, thereby extracting the M-wave. Step S1 includes: Step 1.1: Calculate the mean, standard deviation, quantiles, and signal gradient of the electromyographic signal of the M-wave to be extracted, and adaptively set the amplitude threshold of the stimulation period based on the above parameters to determine the coordinates of the stimulation point and obtain the start and end point coordinate sequence of each pulse. Step 1.2: Adaptively set the pulse width threshold to remove short-duration burst pulse noise; Step 1.3: Adaptively set the pulse distance threshold to achieve segmentation of the stimulation period and the non-stimulation period.
2. The M-wave extraction method based on adaptive threshold according to claim 1, characterized in that, Step S2 includes: Step 2.1: Adaptively set the pulse amplitude threshold to determine the coordinate sequence of the highest and lowest points of the stimulation pulse waveform during the stimulation period; Step 2.2: Remove electrical stimulation pulse artifacts from the stimulation period signal using the FastICA algorithm.