Athena Cai, Year 2 Engineering.
Abstract
Essential tremor is a common life altering condition that causes involuntary shaking which results in the loss of fine motor skills and inability to care for oneself. An algorithm was written in C++ code to differentiate between essential tremors and purposeful muscle movement through an Arduino UNO and an Olimex EKG/EMG shield. The algorithm finds the slope of the line of best fit of a histogram representing electromyography signals to determine whether the muscle movement has been affected by essential tremor. This algorithm was tested on four muscles of the arm affected by essential tremor and necessary in daily functions in three different activities to determine its effectiveness. From the trials it was concluded that the algorithm was effective. Ultimately, this algorithm provides real-time output and a novel approach to detecting essential tremor that can be easily adapted to be compatible with different types and degrees of tremor. Its functions can be used to coordinate tremor suppression and treat essential tremor in a low-risk and non-invasive fashion.
Introduction
Essential tremor (ET) is a life altering condition that causes involuntary shaking which results in the loss of fine motor skills and inability to care for oneself. It is recognized as “the most common movement disorder, affecting up to 10 million people in the U.S.” (WebMD, 2020). ET typically affects the hands and arms, causing these appendages to shake uncontrollably when used. As a result, patients cannot write, type, feed themselves, or reach for or hold objects.
The purpose of the project was to design an algorithm that differentiates between ET and purposeful muscle movement in real time through using histograms of electromyography signals as the subject is moving in order to subdue the tremor while not impeding purposeful movement. The algorithmic approach was inspired by the results from a research paper by Ruonala, Meigal, Rissanen, Airaksinen, Kankaanpää , and Karjalainen (2013). This paper presented and compared the histograms (approximate representations of the distribution of numerical data) of electromyographic signals of essential tremor patients and the control group.
Alone, the algorithm detects ET. However, it has the potential to treat ET if used to coordinate electrical muscle stimulation through electrodes. Electrical muscle stimulation can be used to counteract the muscle signals causing ET, thus stopping the involuntary movement. This solution was inspired by galvanism and the clinical usage of electrical stimulation for therapy and muscle control. The product, Cala Trio, from Cala Health also uses external nerve stimulation (Isaacson et al., 2020) to subdue essential tremor but has deficiencies: a 40 minute therapy session is required before patients have an average of 94 minutes of tremor relief (Isaacson et al., 2020). The proposed solution could resolve the inefficiency of the Cala Trio by eliminating stimulation sessions and providing relief in the form of stimulation only when patients move and tremors are detected. Compared to the “6 Proven Ways to Treat Essential Tremor” (Finseth, 2018) presented by Aurora Health Care, the proposed solution is low-risk and non-invasive. The real time detection provided by the developed algorithm is required for this solution to work. This project is an early step to helping people with essential tremor regain control over their bodies and their lives.
Materials and Methods
An Arduino UNO and an Olimex EKG/EMG shield (Fig. 1) were programmed using the C++ programming language.
Figure 1: Materials (electrode pads, Arduino UNO, Olimex EKG/EMG Shield, electrode wires)
The EKG/EMG shield detects electromyographic (EMG) signals, which are “a biomedical signal[s] that measures electrical currents generated in muscles during its contraction representing neuromuscular activities” (Raez et al., 2006). The Arduino was first programmed to produce numerical EMG data in the serial monitor of the Arduino IDE and graph those values in the serial plotter. Next, the algorithm (see Appendix A) reorganizes the data into a histogram with 200 bins, each holding one integer value. The histogram is constantly changing, and holds a limited amount of data. It ‘discards’ old data with new data once the limit is reached by using a vector array. Next, the algorithm uses the least square method (Fig. 2) to find the slope of the line of best fit of half the histogram.
Figure 2: the least square method
Finally, the algorithm compares the slope value to a threshold value in an if/else statement. This threshold value was predetermined by overlaying grid lines on the control group and essential tremor patient histograms provided in Ruonala et. al, (2013). Coordinates were taken from the grids to calculate the slopes of the lines of best fit (See Appendix B). The threshold is a value slightly above the average between the two slopes.
Figure 3: ET histogram provided by Ruonala et. al, (2013). overlaid with grid to determine threshold, slope value = 0.30
Figure 4: CO histogram provided by Ruonala et. al, (2013). overlaid with grid to determine threshold, slope value = 0.24
Ruonala et al (2013). observed that the “the steepness of the histogram increases when comparing between ET [essential tremor patients] (Fig. 3) and CO [subjects in the control group] (Fig. 4)” (2013). This observation provided the rationale behind the if/else statement. If the calculated slope value is above the threshold value, the algorithm (Fig. 5) determines that the electromyography signals are caused by essential tremors. If the slope value is below the threshold value the algorithm determines that the signals are caused by purposeful movement.
Figure 5: The algorithm broken down into a flow chart
The EKG/EMG shield was used to test the algorithm by sticking electrode pads wired to the shield on the right arm of the author. Three electrode pads were placed on the biceps brachii, as outlined in the procedures of Ruonala et al. in their paper. Testing was also done with electrode pads placed as seen in a paper by Zhongliang Yang and Yumiao Chen (2016) over the forearm muscles that control fine motor skills and are affected by essential tremor: the flexor carpi radialis, extensor carpi ulnaris, and extensor carpi radialis brevis.
Figure 6: Electrode placement
Figure 7: Electrode placement
During these tests three actions were performed: writing (“the quick brown fox jumps over the lazy dog”) , pouring water, and raising a glass to the mouth, five times each, and five times again while mimicking essential tremor. Essential tremor was mimicked by watching online video demonstrations of tremors and producing similar motion to the best of the subject’s ability.
As described by Hess and Pullman (2012), there are three action classifications of essential tremor: postural (“occurring while maintaining a posture against gravity”), kinetic (“occurring during active movement”), and intention (“tremor that is specific to goal-directed movements”, also a part of kinetic tremor) (Hess and Pullman, 2012). The activities of the testing accounted for each type of tremor. Postural tremor would occur when holding an arm out straight or when pouring water. Kinetic tremor would occur when writing. Intention tremor would occur when raising a glass to one’s mouth for a drink. The serial monitor produced real-time slope values as testing transpired, as can be seen in Fig. 8 where the numbers on the left are the slope values as the action in the image on the right was completed. The approximate range of slope values that appeared from the beginning to end of the action were recorded for each trial .
Figure. 8: Testing the algorithm (values on the left are the calculated slope values)
Results
The slope changed in real time with the input; if the arm was held steady or at rest, the slope of the line of best fit of the histograms of electromyography signals stayed relatively low, in the range of 0.15 – 0.28. A shaking arm mimicking essential tremor made the slope steeper and higher values were calculated, in the range of 0.28 – 0.36 (Tables 1-4). Mimicking essential tremor produced slope values higher than those produced when performing actions normally in all tests on tested muscle/nerve groups.
Table 1: Biceps Brachii Maintaining a Posture Against Gravity
Table 2: Pouring Water
Key
M1 (Muscle 1): Biceps brachii
M2: Flexor carpi radialis
M3: Extensor carpi ulnaris
M4: Extensor carpi radialis brevis
Table 3: Writing
Table 4: Raising Cup Towards Mouth
Discussion
The algorithm is able to differentiate between ET and purposeful muscle movement in real time by comparing a threshold value to calculated histogram best fit line slope values. The next steps for this project would include testing the algorithm on actual ET patients, followed by researching and experimentation with using electrodes to subdue tremors.
The four muscles tested with electrode pads: the biceps brachii, flexor carpi radialis, extensor carpi ulnaris, and extensor carpi radialis brevis, yielded slightly different slopes when performing the same action. This means that different thresholds would be required for different algorithms attuned to each muscle. However, the fact that ET will cause a higher slope than only purposeful muscle movement is a conclusion that can be drawn from the EMG signals of all four muscles during all three activities. These results confirm the conclusions drawn by Ruonala et al. The calculated slopes (see calculations in Fig.s 9-10) of the histograms presented by Ruonala et al. (2013) for maintaining a posture against gravity with the biceps brachii were comfortably within the data ranges taken from each test. The results of this paper also build on to the findings of Ruonala et al. Other muscles (flexor carpi radialis, extensor carpi ulnaris, and extensor carpi radialis brevis) seemed to follow a similar histogram slope trend between control and ET. However, the results are limited because no essential tremor patient tested the algorithm: rather movements were mimicked. With adjustments and the necessary equipment, this algorithm could likely be successful in differentiating essential muscle movement from purposeful movement during the common activities one performs to take care of themself.
Figure 9: Calculating Slope of Left Side of Left ET Histogram
Figure 10: Calculating Slope of Left Side of Left CO Histogram
References
6 proven ways to treat essential tremor. (n.d.). Retrieved October 21, 2020, from https://www.aurorahealthcare.org/patients-visitors/blog/6-proven-ways-to-treat-essential-tremor
Bobarino. (2006). Graph paper. Own work, used Image:GraphPaper.png as reference This W3C-unspecified vector image was created with Inkscape . https://commons.wikimedia.org/wiki/File:Graph-paper.svg
Botulinum toxin injections. (n.d.). Essential Tremor. Retrieved May 2, 2021, from https://essentialtremor.org/resource/botulinum-toxin-injections/
Bötzel, K., Tronnier, V., & Gasser, T. (2014). The differential diagnosis and treatment of tremor. Deutsches Aerzteblatt Online. https://doi.org/10.3238/arztebl.2014.0225
C++ crash course for beginners. (n.d.). Retrieved March 10, 2021, from https://www.youtube.com/watch?v=1v_4dL8l8pQ
Dosen, S., Muceli, S., Dideriksen, J. L., Romero, J. P., Rocon, E., Pons, J., & Farina, D. (2015). Online tremor suppression using electromyography and low-level electrical stimulation. IEEE Transactions on Neural Systems and Rehabilitation Engineering, 23(3), 385–395. https://doi.org/10.1109/TNSRE.2014.2328296
Essential tremor and deep brain stimulation. (n.d.). WebMD. Retrieved May 2, 2021, from https://www.webmd.com/brain/essential-tremor-brain-stimulation
Essential tremor—Diagnosis and treatment—Mayo clinic. (n.d.). Retrieved May 2, 2021, from https://www.mayoclinic.org/diseases-conditions/essential-tremor/diagnosis-treatment/drc-20350539
Essential tremor—Dr. George plotkin. (n.d.). Retrieved May 2, 2021, from https://www.youtube.com/watch?v=Sz9LlVxHsvc
Examples of essential tremor | Cala Health. (n.d.). Retrieved March 10, 2021, from https://www.youtube.com/watch?v=ze1U9ogjIng
Hess, C. W., & Pullman, S. L. (2012). Tremor: Clinical phenomenology and assessment techniques. Tremor and Other Hyperkinetic Movements, 2. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3517187/
Isaacson, S. H., Peckham, E., Tse, W., Waln, O., Way, C., Petrossian, M. T., Dahodwala, N., Soileau, M. J., Lew, M., Dietiker, C., Luthra, N., Agarwal, P., Dhall, R., Morgan, J., Calakos, N., Zesiewicz, T. A., Shamim, E. A., Kumar, R., LeWitt, P., … Pahwa, R. (2020). Prospective home-use study on non-invasive neuromodulation therapy for essential tremor. Tremor and Other Hyperkinetic Movements, 10(0), 29. https://doi.org/10.5334/tohm.59
Line of best fit(Least square method). (n.d.). Retrieved March 10, 2021, from https://www.varsitytutors.com/hotmath/hotmath_help/topics/line-of-best-fit#:~:text=Step%201%3A%20Calculate%20the%20mean,mean%20of%20the%20y%20%2Dvalues.&text=Step%204%3A%20Use%20the%20slope,best%20fit%20for%20the%20data.
Moreno-Aranda, J., & Seireg, A. (1981). Electrical parameters for over-the-skin muscle stimulation. Journal of Biomechanics, 14(9), 579–585. https://doi.org/10.1016/0021-9290(81)90083-X
Mr-guided focused ultrasound for tremor. (n.d.). Cleveland Clinic. Retrieved May 2, 2021, from https://my.clevelandclinic.org/health/treatments/21087-mr-guided-focused-ultrasound-for-treatment-of-tremor
Münchau, A., Schrag, A., Chuang, C., MacKinnon, C. D., Bhatia, K. P., Quinn, N. P., & Rothwell, J. C. (2001a). Arm tremor in cervical dystonia differs from essential tremor and can be classified by onset age and spread of symptoms. Brain, 124(9), 1765–1776. https://doi.org/10.1093/brain/124.9.1765
Münchau, A., Schrag, A., Chuang, C., MacKinnon, C. D., Bhatia, K. P., Quinn, N. P., & Rothwell, J. C. (2001b). Arm tremor in cervical dystonia differs from essential tremor and can be classified by onset age and spread of symptoms. Brain, 124(9), 1765–1776. https://doi.org/10.1093/brain/124.9.1765
Program to make a histogram of an array. (2017, October 2). GeeksforGeeks. https://www.geeksforgeeks.org/program-make-histogram-array/
Redirect notice. (n.d.). Retrieved March 10, 2021, from https://www.google.com/url?sa=i&url=https%3A%2F%2Fonline.stat.psu.edu%2Fstat500%2Fbook%2Fexport%2Fhtml%2F539&psig=AOvVaw2wDaaYynz7seauDNJ0VA3m&ust=1615460820997000&source=images&cd=vfe&ved=0CA0QjhxqFwoTCOD389zKpe8CFQAAAAAdAAAAABAD
Richardson father risks freedom to promote cannabis treatments for his daughter. (n.d.). Retrieved March 10, 2021, from https://www.youtube.com/watch?v=FSdjvEnyRzk
Ruonala, V., Meigal, A., Rissanen, S. M., Airaksinen, O., Kankaanpaa, M., & Karjalainen, P. A. (2013). EMG signal morphology in essential tremor and Parkinson’s disease. Annual International Conference of the IEEE Engineering in Medicine and Biology Society. IEEE Engineering in Medicine and Biology Society. Annual International Conference, 2013, 5765–5768. https://doi.org/10.1109/EMBC.2013.6610861
Shaikh, A. G., Miura, K., Optican, L. M., Ramat, S., Tripp, R. M., & Zee, D. S. (2008). Hypothetical membrane mechanisms in essential tremor. Journal of Translational Medicine, 6(1), 68. https://doi.org/10.1186/1479-5876-6-68
Shield-ekg-emg bio-feedback shield user’s manual. (2014). Olimex Ltd. https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/resources/SHIELD-EKG-EMG.pdf
The brain and essential tremor. (n.d.). WebMD. Retrieved April 29, 2021, from https://www.webmd.com/brain/essential-tremor-basics
Thenganatt, M. A., & Louis, E. D. (2012). Distinguishing essential tremor from Parkinson’s disease: Bedside tests and laboratory evaluations. Expert Review of Neurotherapeutics, 12(6), 687–696. https://doi.org/10.1586/ern.12.49
Using histograms to understand your data. (2019, February 11). Statistics By Jim. http://statisticsbyjim.com/basics/histograms/
Vector in c++ stl. (2015, December 7). GeeksforGeeks. https://www.geeksforgeeks.org/vector-in-cpp-stl/
Yang, Z., & Chen, Y. (2016). Surface emg-based sketching recognition using two analysis windows and gene expression programming. Frontiers in Neuroscience, 10, 445. https://doi.org/10.3389/fnins.2016.00445Zhang, J., Xing, Y., Ma, X., & Feng, L. (2017, August 14). Differential diagnosis of parkinson disease, essential tremor, and enhanced physiological tremor with the tremor analysis of emg [Research Article]. Parkinson’s Disease. https://doi.org/https://doi.org/10.1155/2017/1597907
Appendix
Algorithm Code