Abstract
Clonus can disrupt daily activities after spinal cord injury. Here an algorithm was developed to automatically detect contractions during clonus in 24-hour electromyographic (EMG) records. Filters were created by non-linearly scaling a Mother (Morlet) wavelet to envelope the EMG using different frequency bands. The envelope for the intermediate band followed the EMG best (74.8–193.9 Hz). Threshold and time constraints were used to reduce the envelope peaks to one per contraction. Energy in the EMG was measured 50 ms either side of each envelope (contraction) peak. Energy values at 5 % and 95 % maximal defined EMG start and end time, respectively. The algorithm was as good as a person at identifying contractions during clonus (p = 0.946, n=31 spasms, 7 subjects with cervical spinal cord injury), and marking start and end times to determine clonus frequency (intra class correlation coefficient, α: 0.949), contraction intensity using root mean square EMG (α: 0.997) and EMG duration (α: 0.852). On average the algorithm was 574 times faster than manual analysis performed independently by two people (p≤ 0.001). This algorithm is an important tool for characterization of clonus in long-term EMG records.
Keywords: spinal cord injury, muscle spasm, clonus, wavelet analysis, surface EMG
1. Introduction
Clonus is one kind of involuntary muscle contraction (spasm) often seen in muscles paralyzed by spinal cord injury (SCI; Beres-Jones et al., 2003; Little et al., 1989; Wallace et al., 2005). It involves repetitive contractions followed by periods of relative muscle silence (Cook, 1967; Dimitrijevic et al., 1980; Rack et al., 1984; Walsh, 1976). Some individuals describe clonus as manageable, whereas others consider it extremely distracting because it interferes with daily activities (Adams and Hicks, 2005; Little et al., 1989; Sheean, 2002). Only a few studies have focused on quantifying clonus in the controlled environment of a laboratory or a clinic by measuring overall clonus duration, contraction frequency or duration (Dimitrijevic et al., 1980; Iansek, 1984; Rack et al., 1984; Rossi et al., 1990; Wallace et al., 2005; Walsh, 1976). Whether these observations provide a representative view of the clonus that occurs throughout the day in muscles paralyzed by SCI is unclear. Furthermore, the magnitude of the EMG has not been evaluated systematically in these previous studies but could provide valuable information about the intensity of the muscle contractions. The prevalence of clonus is also unknown.
We have made long-term (24-hour) electromyographic (EMG) recordings from paralyzed leg muscles to quantify the prevalence and characteristics of involuntary muscle contractions after cervical SCI. For the clonus identified in these records, it is possible to measure the magnitude and the duration of the EMG in each contraction, the frequency of the contractions, and the total duration of the clonus. Manual analysis is laborious and time consuming, particularly for 24 hour records. Thus, the main aims of this study were to develop an algorithm that automatically: 1) identifies when the bursts of EMG occur during clonus, and 2) marks the start and end of these contractions. The timing of these events can be used to calculate the duration, frequency and intensity of the contractions during the entire spasm. To be effective, this algorithm must be capable of accurately identifying the occurrence of the repeated bursts of EMG during clonus, while at the same ignoring any motor unit activity between these contractions. The start and end of each contraction must be determined irrespective of the size (magnitude or duration) of the contractions or the overall duration of the clonus. While the start and end of EMG are often measured manually in laboratory-based studies, the number of contractions is usually limited. Isometric or constant velocity contractions are often performed. These constraints make manual analysis feasible. In contrast, we are monitoring clonus as it occurs naturally during the day-to-day activities of people with SCI who have no voluntary control of leg muscles. Thus, our algorithm needs to be flexible enough to analyze data gathered under a variety of conditions, from different muscles, and individuals.
Only a few algorithms have been developed to identify the onset of EMG. Data have been scanned using single or double windows, a technique that does not suppress intra-burst maxima (Di Fabio, 1987; Marple-Horvat and Gilbey, 1992). Polynomial regression is another approach but this requires calculation of steady state parameters and equations for each EMG pattern (Takada and Yashiro, 1995). EMG onset has also been defined as the time when a specified number of sample points exceed an established baseline (Di Fabio, 1987; Hodges and Bui, 1996). Statistical approaches have used dual thresholds to detect muscle activation (Bonato et al., 1998) or a generalized likelihood ratio to estimate EMG onset (Micera et al., 1998). Recent approaches have included use of wavelet transforms to either identify motor unit action potentials at contraction onset (Merlo et al., 2003) or to detect the sudden changes in EMG that occur at the start and end of a contraction (Vannozzi et al., 2010).
The algorithm developed in this study to automate the analysis of EMG during clonus also used wavelets for event-oriented analysis. Wavelets were scaled non-linearly to create a bank of filters which were used to extract time-frequency information from the EMG (von Tscharner, 2000). To aid identification of the bursts of EMG during clonus, the algorithm was constrained using criteria we developed from our knowledge of clonus. Signal energy rules were then applied to the globally processed EMG signals to extract the duration of each burst of EMG, clonus frequency and intensity. To evaluate the reliability of the algorithm, its outputs were compared to the results produced independently by two experts with years of experience in EMG recognition. The total amount of time taken by each person to manually mark the start and end of each burst of EMG during clonus was also compared to the time taken by the algorithm to perform the same task. An accurate algorithm that can automatically analyze EMG during clonus in long records is important to understand the nature of these involuntary muscle contractions, and the prevalence of clonus.
2. Materials and Methods
2.1 Subjects
Seven subjects (5 male, 2 female, median age: 36 yr, range: 27–52 yr) with a chronic (> 1 yr) cervical SCI were studied (median time since injury: 14 yr, range: 4–33 yr). These injuries were caused by diving mishaps (n=4), motor vehicle accidents (n=2), or a sports event (n=1). The injuries were at C4 (n=1), C6 (n=5) or C7 (n=1) and were complete (AIS A) according to American Spinal Injury Association criteria (Maynard et al., 1997). The subjects had no voluntary control of any leg muscles, indicated by an inability to generate any voluntary EMG. Subjects took no medication to mitigate muscle spasms. All of the procedures were approved by the Institutional Review Board of the University of Miami. All subjects gave informed, written consent before participating in this study.
2.2 Muscles
Surface EMG signals were recorded simultaneously from 8 leg muscles over 24 hours: vastus lateralis (VL), biceps femoris (BF), tibialis anterior (TA) and medial gastrocnemius (MG) bilaterally using a bipolar configuration (Klein et al., 2010). Three self adhesive electrodes (Superior Silver Electrodes, Uni-patch, MN) were cut to 2.5 cm × 1.0 cm for each muscle. The distal electrode for TA and MG was placed just proximal to the respective tendon-muscle interface. The distal electrode for vastus lateralis was placed 12 cm proximal to the patella. The other two electrodes for each muscle were placed proximally with an inter-electrode spacing of 4 cm. Electrodes for biceps femoris were aligned with the vastus lateralis electrodes but on the midline of the posterior surface of the leg. The electrodes were secured to the skin with Hypafix tape (Smith & Nephew, Andover, MA) then wrapped with Co-flex bandage (Andover Healthcare, Andover, MA) to ensure that the electrodes stayed in the same position during the entire experiment. The two distal electrodes on each muscle served as the active and reference electrodes. The proximal electrode was the ground. The electrodes from each muscle were connected to the inputs of a preamplifier (Model Z03, Motion Labs Systems, Baton Rouge, LA) via soldered cables. These cables allowed custom electrode spacing, and placement of the preamplifiers on the limb close to the target muscle. Each preamplifier was wrapped in foam to provide comfortable contact with the skin over 24 hours and to avoid skin breakdown.
2.3 Protocol
Each experiment consisted of a 24 hour EMG recording, and laboratory measurements before and after this recording. In the laboratory, maximal compound muscle action potentials (M-waves) were recorded from VL, TA and MG muscles in response to supramaximal stimulation of the femoral, common peroneal and tibial nerves, respectively. These EMG data were sampled on-line (3,000 Hz) using a SC/Zoom system (Physiology section, Umeå University, Sweden). For each muscle, the area of the maximal M-waves were similar before and after the 24-hour recording (Mean ± SE area for MG: 10.2 ± 1.3 μVs versus 10.4 ± 1.6 μVs; TA: 6.9 ± 1.0 μVs versus 6.5 ± 0.9 μVs; VL: 9.0 ± 1.1 μVs versus 9.6 ± 1.1 μVs). These results indicate that the electrodes remained in place during the entire recording and that the changes in EMG activity over 24 hours were recorded faithfully from each muscle (Klein et al., 2010). No M-waves were recorded from BF because the sciatic nerve is too deep to stimulate reliably. Subjects were also asked to perform 3 brief (5 s) maximal voluntary contractions (MVCs) with each muscle. The absence of EMG activity during all MVCs confirmed the muscle paralysis.
The 24 hour EMG recording was initiated after the laboratory measurements using a portable, battery powered data processing and logging system (Tepavac et al., 2003). The electrodes from each muscle were connected to a preamplifier (Motion Labs Systems, Baton Rouge, LA). The outputs from the four preamplifiers for each leg were connected to a custom-built preprocessing unit which was responsible for filtering (10–500 Hz) and amplifying the input signal to fit the input range (0 – 4.096 V; gain: ~400) of a custom-built battery-operated, data logging device with a12-bit analog to digital converter (Tattletale 8 Logger, Onset Computer Corporation, Bourne, MA). This logger was driven by custom software written using Metrowerks Code Warrior (a C based software development tool; Metrowerks Corporation, Austin, TX). The sampling rate was 1000 Hz per channel. The data were written to a 1 GB compact flash card in compressed format.
The subject was advised to maintain his/her normal routines during the 24 hour recording to ensure a representative view of daily activities, which they documented on paper. The data logging system was stored in a hip pack that was carried on the wheelchair or the lap of the subject. The subject returned after 24 hours to repeat the laboratory recordings, as described above.
2.4 Global data processing
Standard data processing procedures were implemented on all 24 hour EMG recordings to enable data comparisons across muscles and experiments. This global processing occurred before the application of the algorithm. Using software developed in Matlab (The Mathworks Inc, Natick, MA) and DADiSP (DSP Development Corporation, Newton, MA), data from each channel were: 1) extracted to 24, 1-hour files, a manageable length for viewing; 2) set to the 24 hour clock (midnight to 1 am was designated as hour 1); 3) digitally filtered to eliminate noise using cascaded 30 Hz high-pass and 60 Hz FIR filters (basic windowed linear-phase Finite Impulse Response digital filters) of order 472; 4) calibrated to match data gathered in the laboratory using 1 mV sine waves; 5) large artefacts, usually from cell phones or uncontrolled movements, were manually identified and excluded from analysis; 6) spasms that involved clonus were manually identified in the 24 hour records by an expert in EMG recognition (at least 3 contractions per spasm, each contraction 40–90 ms in duration, and at a frequency of 3–10 Hz, Wallace et al., 2005).
2.5 Algorithm to automatically analyze EMG during clonus
A frequency specific methodology that involved wavelets was developed here to analyze the bursts of EMG during selected examples of clonus (n=31). Only the EMG from these spasms was subjected to various filters, as described by von Tscharner (2000), to produce intensity envelopes of the signals that both smoothed and preserved the EMG shape. The EMG belonging to each clonus cycle (contraction) then had to be identified. Even with good selectivity, detection of the maxima in the EMG intensity traces may produce false positive peaks. Here, these additional peaks were effectively pruned by using rules involving amplitude thresholds and timing constraints. Once the contraction maximum was detected, the onset and offset of each contraction was computed from the globally processed EMG signals using signal energy rules. Thus, most frequency components of the EMG signal contributed to the physiological characterization of clonus.
The algorithm developed here to automate the identification of contractions during clonus, as well as the start and end of the EMG for each contraction (Fig. 1A) involved 5 steps. This algorithm is explained in detail in Figure 2 and the following sections:
Fig. 1.
EMG during clonus. A. Three cycles of clonus with the start (---) and end (…) of the unrectified EMG marked for each contraction. The EMG were recorded from the left medial gastrocnemius muscle (hour 15: 3–4 pm) of a subject with a SCI at C4. B. The same EMG rectified and with an overlay of the linear envelopes generated for the high, intermediate and low frequency bands. Arrows show the EMG peaks identified by the algorithm without constraints. C. The EMG from one contraction enclosed by a default window (---), a resized window (…), and the start and end of the EMG (__) determined by the algorithm for the resized window. Shortening the window excluded the motor unit potential between the contractions.
Fig. 2.
Flow chart of the steps the algorithm implemented to automatically identify contractions during clonus and to mark the starts and ends of the EMG. EMG (globally processed) was input to the algorithm twice.
2.5.1. Filter creation
A mother wavelet (Morlet wavelet) was scaled non-linearly to produce a set of 10 filters with different central frequencies and frequency ranges (Table 1), as described by von Tscharner (2000).
Table 1.
Frequencies used to create filters
| Wavelet index (j) | Central | Frequency (Hz) | |
|---|---|---|---|
| Minimum | Maximum | ||
| 1 | 19.3 | 11.5 | 27.1 |
| 2 | 37.7 | 27.0 | 48.5 |
| 3 | 62.1 | 48.5 | 75.8 |
| 4 | 92.4 | 74.8 | 110.0 |
| 5 | 128.5 | 108.0 | 149.0 |
| 6 | 170.4 | 147.0 | 193.9 |
| 7 | 218.1 | 191.8 | 244.5 |
| 8 | 271.5 | 242.2 | 300.8 |
| 9 | 330.6 | 297.4 | 363.8 |
| 10 | 395.5 | 359.4 | 431.7 |
2.5.2. Filter EMG
The EMG from 31 spasms that involved clonus was passed through each of the filters to produce 10 intensity envelopes for a given input. To improve the processing time of the algorithm, the intensity envelopes were added together to obtain 3 envelopes: one for the lower, intermediate, and higher frequency bands (Fig. 1B). Although all three envelopes followed the EMG signal, the lower frequency envelope (11.5–75.8 Hz) reacted slowly to the changes in the EMG so peaks in the EMG and the envelope were misaligned. The higher frequency envelope (191.8–431.7 Hz) was highly reactive to the changes in the signals but this produced many peaks in the envelope. The intermediate frequency envelope (74.8–193.9 Hz) offered a compromise between the two other envelopes in terms of sensitivity to changes in the EMG and the production of multiple peaks. Moreover, the largest peak in the envelope for a given contraction usually occurred near the middle of each contraction and coincided with the peak EMG amplitude. This feature facilitated accurate determination of the time of the EMG bursts so the intermediate frequency envelope was used for subsequent analysis (Fig. 1B).
2.5.3. Detect bursts of EMG during clonus
The crucial step of the algorithm was to detect each burst of EMG as this process accurately identified the number of contractions that occurred during clonus. The times at which peaks occurred in the envelope were determined by calculating the first derivative of the envelope and observing the changes in the value of the slope. To ensure that each contraction was represented by only one peak, not multiple peaks, two constraints were imposed on the algorithm:
An intensity threshold was established to eliminate lower peaks due to small EMG potentials or baseline noise. For 95 % of the data, a suitable threshold was 25 μV2, determined by viewing the rectified EMG and the intensity envelope in DADiSP software. The peaks in the envelope that remained after application of this constraint were largely confined to the burst of EMG.
A 90 ms time constraint between adjacent peaks was then applied. If multiple peaks were encountered within 90 ms, the algorithm kept the peak with the maximum amplitude, which often occurred at the peak EMG (Fig. 1B). To determine this time constraint, the number of contractions in the various spasms involving clonus was counted manually and compared to the peaks identified by the algorithm. The time between peaks was progressively changed from 40 ms to 120 ms in steps of 10 ms until the peaks detected by the algorithm matched the manual count, which occurred when the separation between peaks was 90 ms.
2.5.4. Mark EMG start and end for contractions during clonus
A window was placed around each peak in the envelope detected by the algorithm, from the midpoint of the previous peak to the midpoint of the next peak (Fig. 1C). The entire record was therefore covered with consecutive windows. The total energy of the globally processed EMG signal in each window was computed using the equation:
where: X(t) is the globally processed EMG signal, Ws is the start of the window, and We is the end of the window. When the total energy of a window was <10 mV2, a typical value for a single motor unit potential, the window was discarded, further reducing the number of bursts of EMG identified by the algorithm. The points at which the energy in each window reached 5 % and 95 % of the total energy were marked as EMG start and end, respectively. Energy values outside of the 5–95 % range were usually baseline noise. However in certain recordings, motor unit potentials were present 60–80 ms before EMG onset (Fig. 1C), and they contributed to the energy in the window. To eliminate this motor unit activity from the energy calculation, each window (irrespective of whether a motor unit potential was present before the main EMG burst) was resized to 50 ms either side of the envelope peak. The burst of EMG remained within the window because it typically lasted 40–70 ms (Dimitrijevic et al., 1980; Wallace et al., 2005). The energy contained within the resized window was recalculated and the starts and ends of all of the EMG bursts remarked at the revised 5–95 % values (Fig. 1C).
2.5.5. Calculation of clonus parameters
The start and end times for each burst of EMG (contraction) during clonus were used to calculate: 1) EMG duration, the time from the start to the end of each burst of EMG; 2) clonus frequency (the reciprocal of the time between consecutive EMG starts); 3) EMG intensity, the root mean square value (RMS) of the EMG for each contraction, from EMG start to end; 4) clonus duration, the time from the first EMG start to the last EMG end during clonus.
2.6 Assessment of algorithm performance
Spasms involving clonus (n=31, 5 spasms/subject; clonus only occurred once during the 24 hour recording from one person) were analyzed automatically by the program and manually and independently by two experts. The assessment database accounted for up to 6 % of the total number of spasms involving clonus during these 24 hour recordings. Data came from medial gastrocnemius (n=20 spasms), tibialis anterior (n=4), biceps femoris (n=2), and vastus lateralis (n=5), reflecting the typical prevalence of clonus in these muscles (Wallace et al., 2011). Results from one expert (Person 1, P1) were used as a gold standard. Algorithm performance was evaluated by comparing the results of two people (P1; Person 2, P2) to the data obtained from Person 1 versus the Program (Pr). Comparisons made were: 1) the number of common contractions (bursts of EMG) identified during each clonus; 2) agreement for EMG duration (the amount of common time measured for each contraction, calculated from each EMG start and end); 3) agreement for clonus frequency. Data for P2 and the Pr were calculated as a percentage of the values obtained by P1; 4) agreement on the RMS values of the EMG, calculated for P2 and the Pr as a percentage of the RMS value obtained by P1; 5) the time taken to measure the data. These same data were re-evaluated by muscle to examine whether the results depended on the source of the EMG signals.
To assess whether the algorithm could be used to analyze novel data, clonus in medial gastrocnemius was analyzed in one 24 hour EMG recording from Subject F. A total of 71 spasms that involved clonus were identified in this record. One of these spasms was used to train the algorithm. The other 70 spasms were analyzed using the final algorithm. The number of common contractions in these 70 new spasms, and agreement for EMG duration, clonus frequency and RMS EMG were compared for Person 1 and the algorithm, as described above.
2.7 Statistics
Data are presented as median (range) unless stated otherwise. Kruskal-Wallis one way ANOVA on ranks was used to evaluate agreement on the number of common contractions measured with and without algorithm constraint, EMG duration, clonus frequency, contraction intensity, as well as whether the algorithm was faster than manual analysis. Intra-class correlations (ICC) were calculated to verify the inter-rater reliability of EMG durations, clonus frequency, and RMS EMG (model-3 i.e., the two-way mixed effect module). ICC coefficients can range from 0 (no agreement) to 1 (complete agreement) with a value greater than 0.80 regarded as satisfactory (Nunnally and Bernstein 1994). Chi-square tests were performed to verify whether agreement between two people versus a person (P1) and the algorithm were different statistically. Statistical significance was set at p<0.05. Statistical analyses were performed using SPSS-17.0 (SPSS Inc, Chicago, IL) and Sigmastat (Systat Software, San Jose, CA).
3. Results
3.1. Number of contractions during clonus
Fig. 1A shows an example of the rhythmic repeated contractions of clonus, with the EMG start and end marked for three contractions. Person 1 manually marked the starts and ends of 825 bursts of EMG during clonus (7 subjects, 31 spasms). Across subjects the median number of contractions was 110 (range: 7–227; Fig. 3A). Without any constraints, the algorithm identified a total of 4980 EMG bursts (subject median: 708, range: 48–1304), which represented a median of 686 % more contractions than Person 1 (range: 409–901 %, n=7 subjects, Fig. 3B). Two sets of constraints were applied to improve the ability of the algorithm to detect contractions during clonus: 1) an intensity threshold to eliminate low peaks due to small EMG potentials or baseline noise; 2) a time constraint to prevent motor unit potentials between contractions being marked as bursts of EMG. Introduction of the intensity constraint resulted in the algorithm marking a median of 136 bursts of EMG across subjects (range: 10–247 contractions, n=7). This first set of constraints reduced the contractions marked by the algorithm to a median of 118 % of that marked by Person 1 (range: 106–143 %, n=7). The second set of constraints (resizing the window placed around EMG bursts to eliminate motor unit potentials near the start of the contraction and removal of windows with energy as small as a single motor unit potential) bought the number of bursts of EMG identified by the algorithm to a median of 109 across subjects (range: 8–218 contractions, n=7; median: 99 %, range: 78–114 % of Person 1). Constraint of the algorithm reduced the false detection of contractions significantly (p ≤ 0.001).
Fig. 3.
Algorithm performance with and without constraints. A. Median number of contractions identified by the algorithm with no constraints, one, or two sets of constraints (filled bars) compared to the analysis of Person 1 (n=31 spasms, n=7 subjects, 5 spasms per subject except when clonus occurred once in a 24 hour recording). B. Same data as in A, expressed as a percentage of the results generated by Person 1. C. Median (25th and 75th percentiles) agreement for common contractions measured by Person 1 (P1) versus Person 2 (P2) compared to Person 1 versus the Program (Pr). Data for each subject are shown with different symbols.
3.2. Number of common contractions measured during clonus
Overall Person 1, Person 2 and the constrained Program measured a total of 825, 821, and 830 contractions during clonus, respectively. The median number measured across 7 subjects was 112 for Person 2 (range: 7–219). Not all contractions identified by each person and the program were the same. The median agreement for common contractions measured per subject was 99 % for two people (range: 94–100 %), and 98 % for Person 1 versus the Program (range: 92–100 %, Fig. 3C). The agreement between two people versus Person 1 and the Program did not differ significantly (p=0.946). Thus the algorithm was as effective as two people at identifying contractions during clonus. Differences in the marked contractions arose because Person 1 identified low amplitude bursts of EMG which were unmarked by both Person 2 and by the Program. Both people ignored isolated motor unit potentials whereas the constrained program sometimes marked these potentials as bursts of EMG.
3.3. Clonus duration and frequency
For the 31 spasms analyzed, median clonus duration (entire spasm duration) measured by P1 was 4.3 s (range: 1.1–43.4 s). The median cycle durations measured by Person 1, Person 2 and the Program were 167 ms (119–208 ms, n=7 subjects), 163 ms (120–204 ms) and 172 ms (119–204 ms), respectively, resulting in median clonus frequencies of 6.0 Hz (4.8–8.4 Hz), 6.1 Hz (4.9–8.3 Hz), and 5.8 Hz (4.9–8.4 Hz) respectively. The median agreement for clonus frequency was 99.9 % (range: 99.0–100 %, n=7; ICC: 0.971) between Person 1 and Person 2, and 99.7 % (range: 98.5–100 %; ICC: 0.949) between Person 1 and the Program (Fig. 4A). The differences in clonus frequency for two people versus Person 1 and the Program were not different statistically (p=0.718). Thus, the algorithm determined clonus frequency as reliably as two people.
Fig. 4.
Agreement on clonus frequency, duration and intensity. The median (25th and 75th percentiles) agreement for clonus frequency (A), EMG duration (B), and RMS EMG (C) analyzed by Person 1 (P1) and Person 2 (P2) versus Person 1 and the Program (Pr, n=7 subjects). Results for each subject are shown by unique symbols.
3.4. Duration of EMG during clonus
The median EMG durations (time from EMG start to end, Fig. 1A) measured by Person 1, Person 2 and the Program were 51 ms (25–56 ms), 43 ms (29–50 ms), and 43 ms (27–52 ms), respectively. The median time differences were close to the average duration of surface recorded motor unit potentials (Thomas et al., 2006). The median common EMG time measured by Person 1 and Person 2 was 83.7 % (77.7–98.1 %, n=7 subjects; ICC: 0.905; Fig. 4B). Person 1 and the Program agreed 75.6 % of the time (range: 70.7–86.3 %; ICC: 0.852). The differences in EMG duration measurements made by two people compared to Person 1 versus the Program were not significant (p=0.277), indicating that the algorithm was as good as two people at measuring the duration of EMG during clonus.
3.5. Intensity of contractions during clonus
The median RMS values for the EMG measured by Person 1, Person 2 and the Program were 282 μV (177–404 μV, n=7), 289 μV (168–482 μV), and 288 μV (172–462 μV), respectively. The median agreement for RMS EMG was 98.3 % for Person 1 and Person 2 (range: 96.9–99.6 %, ICC: 0.997) and 96.2 % for Person 1 and the Program (range: 94.9–100.0 %, ICC: 0.997; Fig. 4C). As the intraclass coefficients were the same, the Program was as reliable at measuring contraction intensity during clonus as two people.
3.6. Analysis by muscle
Similar agreement between two people versus a person and the program was obtained when these 31 spasms were analyzed by muscle. Agreement for medial gastrocnemius clonus frequency did not differ (p=0.535) between Person 1 and 2 (96.1 %) versus Person 1 and the Program (93.0 %). Agreement for EMG duration (p=0.541; P1 versus P2: 88.4 %; P1 versus Pr: 83.5 %) and RMS EMG (P1 versus P2: 99.9 %; P1 versus Pr: 99.8 %) also did not differ. Similar results were obtained for the data from the other 3 muscles (tibialis anterior, biceps femoris and vastus lateralis). Across these 3 muscles, clonus frequency agreement ranged from 85.2–98.4 % for P1 versus P2 and from 78.2–92.7 % for P1 versus Pr. The corresponding ranges for EMG duration agreement were 82.7–93.0 % (P1 versus P2) and 72.0–90.1 % (P1 versus Pr). For RMS EMG, agreement ranged from 98.1–99.8 % (P1 versus P2) and 98.0–99.8 % (P1 versus Pr). The algorithm therefore performed similarly irrespective of the source of the EMG signals.
3.7. Measurement time
To view and mark the start and the end of the EMG for contractions in 31 spasms involving clonus took 5.7 hours for Person 1, 12.6 hours for Person 2, and 0.019 hours for the algorithm. The algorithm was significantly faster at analysis than both of the human operators (p ≤ 0.001), who took a similar time to measure the clonus (p ≥ 0.05). As an example, it took Person 1 1440 s (24 min) to measure the start and end of EMG in clonus that lasted 10 s. Person 2 took 3180 s (53 min) to measure the same data, while the Program completed the measures in 1.64 s. These results indicate the efficiency of this novel algorithm.
3.8. Application of the algorithm to new data
For 70 novel spasms, Person 1 and the algorithm identified 1995 and 2035 common contractions during clonus, respectively, with agreement (98 %) the same as for the 31 test spasms. The median cycle durations were 165 ms (range: 112–295 ms) and 161 ms (117–295 ms), corresponding to median clonus frequencies of 6.3 Hz (4.0–9.2 Hz) and 6.5 Hz (3.6–8.9 Hz), respectively. Agreement for clonus frequency was 99.6 %, the same as for the 31 test spasms. The median EMG durations measured by Person 1 and the algorithm were 44 ms (34–80 ms) and 44 ms (33–86 ms), with 96.7 % agreement for the common time measured. This agreement exceeded that for the test spasms. The median RMS values for the EMG measured by Person 1 and the algorithm were 131 μV (15–395 μV) and 129 μV (15–401 μV), respectively (98.5 % agreement, which exceeded the value of 97.4 % for test spasms). Thus, for each measured parameter, median agreement for 70 novel spasms either equaled or exceeded that for the 31 spasms used to test the algorithm. The algorithm developed here could therefore be used to accurately determine the characteristics of clonus when applied to novel data. The major difference was algorithm efficiency. It took 8 minutes for the algorithm to analyze the clonus in 70 spasms. An additional 4.3 hours was spent by Person 1 manually viewing, verifying and/or altering the algorithm output for every burst of EMG during these spasms. We estimate it would take 18 hours for Person 1 to mark the start and end of every contraction during clonus in the same 70 spasms manually.
4. Discussion
The algorithm developed in this study was able to automatically determine the location of muscle contractions during clonus, the duration and the intensity of the EMG for each contraction, and clonus frequency. The algorithm was as accurate as two people at measuring these parameters but performed these operations significantly faster than either person. The agreement between a person and the program was highest for clonus frequency, followed by EMG intensity and duration. Efficient detection of the contractions was refined by imposing threshold and time constraints on the algorithm. These constraints were key to accurate characterization of clonus.
4.1 Detection of contractions during clonus
The algorithm developed here used intensity analysis to envelope the EMG in different frequency bands (von Tscharner, 2000). An intermediate band of frequencies (75–194 Hz), which included many of the frequency components found in surface EMG, gave an envelope that closely followed the EMG. Peaks in the envelope typically coincided with peaks in the EMG which arose from different motor units firing asynchronously (Wallace et al., 2005). But the algorithm needed to identify only one envelope peak for each contraction so that each EMG start and end time could be measured. This was achieved by imposing constraints that were developed from the known characteristics of clonus. For example, clonus involves rhythmic contractions that repeat at a rate largely determined by the length of the reflex arc (3–10 Hz; Dimitrijevic et al., 1980; Iansek, 1984; Wallace et al., 2011). Moreover, the bursts of EMG during clonus are of relatively fixed duration, consistent with microneurographic recordings that show muscle spindle afferents only discharge late in the muscle relaxation phase of sustained clonus (Hagbarth et al., 1975; Szumski et al., 1974). To confine the envelope peaks to the bursts of EMG, small peaks between the contractions were discarded effectively with the same intensity threshold. To extract a single peak per contraction, the envelope peaks had to be separated by 90 ms (clonus frequency < 10 Hz). If there were multiple peaks within 90 ms, the maximal peak was selected to represent a burst of EMG. In general, the constrained algorithm marked the same contractions as Person 1 (98 % agreement, range: 92–100 %). Two people agreed on 99 % (range: 94–100 %) of the contractions. The measured data were from 7 different experiments and at least 2 different muscles per recording (except for one subject who experienced clonus once in 24 hours). Thus, the algorithm performed robustly across subjects and muscles despite the uncontrolled environment in which the data were gathered. In terms of discrepancies, both people ignored isolated motor unit potentials, a typical way for clonus to start and end (Wallace et al., 2005). The Program sometimes marked these potentials as bursts of EMG because they occurred at clonus frequency, adhered to the 90 ms time constraint, and had sufficient energy to be retained. Second, Person 1 identified low amplitude bursts of EMG, also typical at the start and end of clonus, which were unmarked by the Program or Person 2. In some cases these low bursts of EMG fell below the intensity threshold set for the program.
4.2 Determination of contraction frequency, duration and intensity during clonus
Known characteristics of clonus were also used to guide how the algorithm determined the start and end of EMG for each contraction during clonus. The EMG in each contraction typically rises then declines in amplitude over 40–70 ms (Dimitrijevic et al., 1980), with most motor units firing once during this contraction. In some cases, single motor unit responses were 60–80 ms before the contraction (Wallace et al., 2005). The algorithm captured the main contraction and avoided early motor unit potentials by centering windows around the peaks in the intensity envelopes (± 50 ms). This window just exceeded the typical duration of EMG. The window was usually placed symmetrically on the contraction because the envelope and EMG peaks aligned closely with the maximal peak near the center of the contraction. The times where the energy contained within the resized window reached 5 % and 95 % of the maximal value were optimal for the EMG start and end, respectively.
When motor unit potentials fell within the resized window but just outside of the main contraction they were included in the energy calculation used to determine start and end times. The differences in EMG durations measured by Person 1 and the Program or by two people were 8 ms, close to the average duration of motor unit potentials measured from surface EMG (Thomas et al., 2006). In contrast, a potential with energy smaller than 5 % of the total energy will be excluded. Thus, the chance of inappropriate inclusion of a motor unit potential is higher when the intensity of the EMG burst is low. Besides inclusion of isolated motor unit potentials in the main contraction, some contractions included large amplitude potentials, possibly due to motor units responding in synchrony. In these cases the Program started and ended the EMG early because the majority of the energy was contributed by the big potential alone. This resulted in short EMG durations. In addition, the filters used to eliminate noise and artefacts from the entire 24 hour recording produced a slow wave at the start and end of some contractions and these waves were included by Person 1. The Program excluded these waves because they were less than 5 % of the energy of the window.
Despite these differences, the algorithm was as accurate as two people at determining clonus frequency, duration and intensity. This was the case when data were analyzed by subject or by muscle. Agreement was probably highest for clonus frequency because it was calculated only from the start of the EMG whereas EMG duration involved both the EMG start and end times. Signals smaller than 5 % of maximal energy were largely small EMG potentials, baseline noise, or slow waves from filters. As a consequence, small differences in EMG duration measurements had minimal effect on assessments of contraction intensity measured by people and the algorithm across spasms, muscles and experiments.
Other methods that use wavelet transform techniques to detect the start and end of EMG report accuracy similar to the current study. When contraction start was estimated by identifying motor unit potentials in simulated EMG signals, the standard deviation of the onset estimate was 17 ms for signal to noise ratios between 2 and 8 dB (Merlo et al., 2003). Detection of EMG onset and offset varied between 7 and 11 ms, respectively, when assessed from sudden changes in the EMG signal (Vannozzi et al., 2010). With our method, onset and offset varied between 9 ms and 12 ms, respectively. Implementation of the method developed by Vannozzi et al. (2010) is more complex computationally (multiple modules) than our approach and requires an efficient reasoning module to choose accurate onset and offset times. It would be informative to use this approach in future studies as it may provide a slightly more accurate estimate of EMG onset and offset. But only an incremental improvement in the measurement of clonus frequency can be expected. Current agreement between the program and an EMG expert ranged from 98–100 %. Nevertheless, the fast, rhythmic contractions of clonus are likely to be an important feature that disrupts daily activities.
4. 3 Analysis time
The algorithm was 574 times faster than human operators at locating and measuring the start and end times of bursts of EMG during clonus. An algorithm that is accurate and fast is invaluable for processing large volumes of data. Even though a person needs to verify the output produced by the algorithm when analyzing 24 hour records, the time needed to correct outliers is still 4–5 times less than manual analysis alone. Moreover, human operators measure optimally when the clonus duration is short. A person has to be consistent in their measurements and decision making to measure clonus of long duration (>5 s). This task requires concentration. Otherwise, mistakes are made. Completing this analysis on a regular basis is also laborious and uninteresting. Thus, it is ideal to automate such labor intensive processes to ensure accurate data analysis.
4.4 Analysis of novel data
The final algorithm developed here was used successfully to analyze 70 new examples of clonus with high accuracy. Agreement between Person 1 and the Program either equalled or exceeded that obtained for the 31 test spasms for identification of common contractions, clonus frequency, EMG duration and intensity. Furthermore, the algorithm completed the analysis in minutes. Verification of the results took 4 hours. Visually scanning the EMG records took most of this time. Result correction took little time. In contrast, our experience with manual analysis suggests it would take days for a person to perform this analysis manually. They would then need to verify their results. Thus, this novel algorithm is a valuable resource for timely, accurate analysis of clonus in long duration EMG records.
4.5 Limitations and future developments
There are no existing methods to analyze clonus automatically in long-term (24 hour) EMG recordings. The algorithm developed in this study is one possible approach to this labor intensive task. It was able to successfully process and analyze test and novel spasms in seconds. It worked best when there were no motor unit potentials between contractions. This situation arose in 5 of the 7 recordings. Algorithm constraint helped eliminate false identification of motor unit potentials as contractions. A user could also easily eliminate these extra contractions. Future research could enhance automation further. For example, intensity thresholds to discard small amplitude signals could be adapted depending on the complexity of the EMG. When motor unit potentials were prevalent between the contractions, we found peaks in the envelopes could be reduced by switching to the low frequency envelope. Use of this alternative envelope helped to locate the contractions of interest. Automatic identification of where clonus occurs in 24 hour records could also be implemented.
4. 5 Functional implications
The number of bursts of EMG during clonus is of clinical importance because it conveys information about clonus duration. A longer spasm may make it more difficult to perform daily activities (Adams and Hicks, 2005, Little et al., 1989, Sheean, 2002). RMS EMG can be used to estimate the strength of contractions during clonus, an unexplored area. Strong contractions may be more disruptive to the person. Clonus can occur in a single muscle or simultaneously in multiple muscles (Cook 1967). Analyzing clonus in multiple muscles may allow the resultant limb movement to be predicted. Furthermore, analyzing clonus in long-term (24 hr) EMG recordings may provide a valuable way to evaluate interventions designed to mitigate clonus.
Research Highlights.
Novel algorithm to automatically characterize clonus in long-term EMG records
Wavelets were scaled non-linearly to extract time-frequency information from EMG
Threshold and time constraints improved algorithm accuracy
Robust algorithm performance across muscles, subjects, and time
Potential research tool to facilitate analysis of involuntary muscle contractions
Acknowledgments
The authors thank Sean Ferrell and Dr. Lourdes Silva for identifying clonus in 24 hour EMG records, Adriana Martinez for help with the references and Yenisel Cruz-Almeida for statistical help. This research was funded by National Institutes of Health grant NS30226, The Miami Project to Cure Paralysis, and the Department of Biomedical Engineering, University of Miami.
Footnotes
Publisher's Disclaimer: This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final citable form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.
Contributor Information
Chaithanya K. Mummidisetty, Email: ckmummidisetty@gmail.com.
Jorge Bohorquez, Email: jbohorquez@miami.edu.
Christine K Thomas, Email: cthomas@miami.edu.
References
- Adams MM, Hicks AL. Spasticity after spinal cord injury. Spinal Cord. 2005;43:577–86. doi: 10.1038/sj.sc.3101757. [DOI] [PubMed] [Google Scholar]
- Beres-Jones JA, Johnson TD, Harkema SJ. Clonus after human spinal cord injury cannot be attributed solely to recurrent muscle-tendon stretch. Exp Brain Res. 2003;149:222–36. doi: 10.1007/s00221-002-1349-5. [DOI] [PubMed] [Google Scholar]
- Bonato P, D’Alessio T, Knaflitz M. A statistical method for the measurement of muscle activation intervals from surface myoelectric signal during gait. IEEE Trans Biomed Eng. 1998;45:287–99. doi: 10.1109/10.661154. [DOI] [PubMed] [Google Scholar]
- Cook WA., Jr Antagonistic muscles in the production of clonus in man. Neurology. 1967;17:779–96. doi: 10.1212/wnl.17.8.779. [DOI] [PubMed] [Google Scholar]
- Di Fabio RP. Reliability of computerized surface electromyography for determining the onset of muscle activity. Phys Ther. 1987;67:43–8. doi: 10.1093/ptj/67.1.43. [DOI] [PubMed] [Google Scholar]
- Dimitrijevic MR, Nathan PW, Sherwood AM. Clonus: the role of central mechanisms. J Neurol Neurosurg Psychiatry. 1980;43:321–32. doi: 10.1136/jnnp.43.4.321. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Hagbarth KE, Wallin G, Löfstedt L, Aquilonius SM. Muscle spindle activity in alternating tremor of Parkinsonism and in clonus. J Neurol Neurosurg Psychiatry. 1975;38:636–41. doi: 10.1136/jnnp.38.7.636. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Hodges PW, Bui BH. A comparison of computer-based methods for the determination of onset of muscle contraction using electromyography. Electroencephalogr Clin Neurophysiol. 1996;101:511–9. doi: 10.1016/s0013-4694(96)95190-5. [DOI] [PubMed] [Google Scholar]
- Iansek R. The effects of reflex path length on clonus frequency in spastic muscles. J Neurol Neurosurg Psychiatry. 1984;47:1122–4. doi: 10.1136/jnnp.47.10.1122. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Klein CS, Peterson LB, Ferrell S, Thomas CK. Sensitivity of 24-h EMG duration and intensity in the human vastus lateralis muscle to threshold changes. J Appl Physiol. 2010;108:655–61. doi: 10.1152/japplphysiol.00757.2009. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Little JW, Micklesen P, Umlauf R, Britell C. Lower extremity manifestations of spasticity in chronic spinal cord injury. Am J Phys Med Rehabil. 1989;68:32–6. doi: 10.1097/00002060-198902000-00009. [DOI] [PubMed] [Google Scholar]
- Marple-Horvat DE, Gilbey SL. A method for automatic identification of periods of muscular activity from EMG recordings. J Neurosci Methods. 1992;42:163–7. doi: 10.1016/0165-0270(92)90095-u. [DOI] [PubMed] [Google Scholar]
- Maynard FM, Jr, Bracken MB, Creasey G, Ditunno JF, Jr, Donovan WH, Ducker TB, Garber SL, Marino RJ, Stover SL, Tator CH, Waters RL, Wilberger JE, Young W. International Standards for Neurological and Functional Classification of Spinal Cord Injury. American Spinal Injury Association Spinal Cord. 1997;35:266–74. doi: 10.1038/sj.sc.3100432. [DOI] [PubMed] [Google Scholar]
- Merlo A, Farina D, Merletti R. A fast and reliable technique for muscle activity detection from surface EMG signals. IEEE Trans Biomed Eng. 2003;50:316–23. doi: 10.1109/TBME.2003.808829. [DOI] [PubMed] [Google Scholar]
- Micera S, Sabatini AM, Dario P. An algorithm for detecting the onset of muscle contraction by EMG signal processing. Med Eng Phys. 1998;20:211–5. doi: 10.1016/s1350-4533(98)00017-4. [DOI] [PubMed] [Google Scholar]
- Nunnally JC, Bernstein IH. Psychometric theory. 3. McGraw-Hill; New York: 1994. pp. 83–113. [Google Scholar]
- Rack PM, Ross HF, Thilmann AF. The ankle stretch reflexes in normal and spastic subjects. The response to sinusoidal movement Brain. 1984;107:637–54. doi: 10.1093/brain/107.2.637. [DOI] [PubMed] [Google Scholar]
- Rossi A, Mazzocchio R, Scarpini C. Clonus in man: a rhythmic oscillation maintained by a reflex mechanism. Electroencephalogr Clin Neurophysiol. 1990;75:56–63. doi: 10.1016/0013-4694(90)90152-a. [DOI] [PubMed] [Google Scholar]
- Sheean G. The pathophysiology of spasticity. Eur J Neurol. 2002;9:S3–S9. doi: 10.1046/j.1468-1331.2002.0090s1003.x. [DOI] [PubMed] [Google Scholar]
- Szumski AJ, Burg D, Struppler A, Velho F. Activity of muscle spindles during muscle twitch and clonus in normal and spastic human subjects. Electroencephalogr Clin Neurophysiol. 1974;37:589–97. doi: 10.1016/0013-4694(74)90072-8. [DOI] [PubMed] [Google Scholar]
- Takada K, Yashiro K. Automatic measurement of on/off periods of EMG activity. Medinfo. 1995;8:751–4. [PubMed] [Google Scholar]
- Tepavac D, Thomas CK, Winslow J, Klein CS, Gan X, Dikshit A. Long-term surface EMG recording system. Biomedical Engineering Society meeting; 2003. p. 24. [Google Scholar]
- Thomas CK, Johansson RS, Bigland-Ritchie B. EMG changes in human thenar motor units with force potentiation and fatigue. J Neurophysiol. 2006;95:1518–26. doi: 10.1152/jn.00924.2005. [DOI] [PubMed] [Google Scholar]
- Vannozzi G, Conforto S, D’Alessio T. Automatic detection of surface EMG activation timing using a wavelet transform based method. J Electromyogr Kinesiol. 2010;20:767–72. doi: 10.1016/j.jelekin.2010.02.007. [DOI] [PubMed] [Google Scholar]
- von Tscharner V. Intensity analysis in time-frequency space of surface myoelectric signals by wavelets of specified resolution. J Electromyogr Kinesiol. 2000;10:433–45. doi: 10.1016/s1050-6411(00)00030-4. [DOI] [PubMed] [Google Scholar]
- Wallace DM, Ross BH, Thomas CK. Motor unit behavior during clonus. J Appl Physiol. 2005;99:2166–72. doi: 10.1152/japplphysiol.00649.2005. [DOI] [PubMed] [Google Scholar]
- Wallace DM, Ross BH, Thomas CK. Characteristics of lower extremity clonus after human cervical spinal cord injury. J Neurotrauma. 2011 doi: 10.1089/neu.2010.1549. in press. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Walsh EG. Clonus: beats provoked by the application of a rhythmic force. J Neurol Neurosurg Psychiatry. 1976;39:266–74. doi: 10.1136/jnnp.39.3.266. [DOI] [PMC free article] [PubMed] [Google Scholar]




