The algorithm accepts an electromyographic signal from one muscle and based on parameters input by the user it finds number, amplitude, maximum, and duration of contraction periods. The output is saved as comma delimited text (csv) and images (fig, png). The algorithm was first tested using synthetic electromyographic signals and then using real electromyographic signals from the masseter muscle recorded during eating medium tough food and during sleep.
Our algorithm is alternative to the use of the short-time fast Fourier transform as implemented in order to detect chewing frequency. This was obtained in our script by calculating the inverse of the period of each masticatory cycle.
This script is currently extensively used at the Center of Dental Medicine of the University of Zürich (Switzerland) for the assessment of the daily and nocturnal activities of the masseter muscle of healthy subjects as well as of bruxers. This script was also used in a pilot study at the same Center to investigate the effect of wearing nocturnal occlusal appliance on the masseter muscle activity.
Running the script
Keep all the files belonging to the EMGAT in one folder together with the *.wav file with the EMG signal. It is necessary to explore the signal prior the analysis using for example the freely available software Audacity© (audio editor and recorder). In the “Input” file (comma delimited *.csv file, which can be opened either in NotePad or MS Excel) insert in the first numerical column the desired parameters for your particular file. Note, that in the second column of the numerical values some parameters are inserted as default values based on the previous analysis of the EMG signal of the masticatory muscles. Another file which can be changed (but the default values can be kept,) is “LowerLimitLabels_4histograms.xlsx” (file of MS Excel). During the analysis, four histograms (distributions) of the muscle activities are created. The “LowerLimitLabels_4histograms.xlsx” file contains in separates sheets lower values of the bins for individual histogram (“Duration“, “Avergae_signal“, Max_signal“, “Energy“). No installation is needed. Run the main file “MAIN_EMGMMT2014_csv_XXX.m” (where XXX corresponds to the current version of the script). The input files are automatically loaded. In the end of the computation the user is asked whether or not he wants to save the results. It can happen that already during the analysis the user sees on the plots that the values he chose for the analysis are not the best. Therefore, he does not need the loose time by saving the results. Everything that is printed in the command window is saved in a text file in the working directory. A new folder is created for the result. Name of this folder is based on the name of the input *.wav file. So called “audacity labels” are saved in the resultant folder as well. These will highlight individual activities on the signal in the software Audacity© (File -> Import -> Labels – chose the file from the resultant folder containing the words “AudacityLabels”).
Create scripts with code, output, and formatted text in a single executable document.