Please go to our new site

An example of EMG analysis

Originated March 1999
Last updated

A data record was made in an emotion experiment which included markers in an event channel indicating crucial 10 second sections in the record. An analysis is developed here to produce mean values for each EMG channel for each phase.

PSYLAB7.EXE was used for this analysis. Before beginning the procedure for analysis, data were opened and observed to ensure that the waves were correctly oriented. Toolbar menu (TM), Options, Invert data. was adjusted in this case so that both EMG data and MC16 data are inverted, to compensate for ‘positive up’ recording mode. Also, Options, Treat EMG as rectified. was selected. These settings were then saved using TM, File data, Save settings now. 

PSYLAB was then exited and re-started. Macro record was turned on using TM, Macro, Record macro. Data were opened using toolbar menu, File data, Open data for analysis. This produced a scan view of the entire recording. A typical example is seen below.


Integrated and rectified EMG traces seen in channels 1-8, with events marked in channel 9.

The mouse pointer was positioned on the central body of this Review, and the left mouse button double clicked to produce the Review Menu (RM). Set blocks was selected from this menu, which produced the block selection window. This was adjusted as shown below to obtain 10 second blocks commencing at the time where the event channels comes within a range of +/- 2000. In this recording, events are indicated by a voltage sent to one of the A-D converter channels - this voltage normally causes full range values (i.e. -2048) except when the event is present. The measurement program used is given at the end of these notes.


These settings were then saved to disk in the name HESS1 using block selection window menu, File, Save block settings as. The View Blocks button was then clicked, which produced a multi-block Review containing the required 10 second sections, synchronised with events, seen below.


Multi-block Review containing the required 10 second sections, synchronised with events

The channel selection shown by the row of 1s to the left of each trace was then adjusted so that the eight EMG channels were activated for processing, but the event channel was not. RM, Process, Mean was then selected, by double clicking inside the body of Review#2. This produced a new Review showing just the first block.


The OK button in this Review was then clicked, which opened the Results window, with the selection panel for Mean showing. The Results window was maximised so that this could be completely viewed. Desired results information was selected by following the steps shown in italics for each channel. On channel 8, the ‘terminate line after this channel’ box was checked. This resulted in the following:


Stage 7 was then followed, the large button clicked to transfer the code to RFP. The RFP was saved with the name HESS1 PSYLAB automatically adds appropriate extensions. The RFP generated was as follows: (note that the remarks ‘average amptd lower to band 1’ have no effect and while intended to help the user understand the RFP, they are in fact misleading, owing to a bug in the program).

 select by review#
 output block
 output dat1(01)  ' average amptd lower to band 1
 output dat1(02)  ' average amptd lower to band 1
 output dat1(03)  ' average amptd lower to band 1
 output dat1(04)  ' average amptd lower to band 1
 output dat1(05)  ' average amptd lower to band 1
 output dat1(06)  ' average amptd lower to band 1
 output dat1(07)  ' average amptd lower to band 1
 output dat1(08)  ' average amptd lower to band 1
 output  ' terminate line in result file

The Results panel was then restored to normal size, and the OK button was pressed again in Review#3, this time causing the RFP to run and data to appear in the Results window as follows:

 1              11.84448       13.78595       7.942627       13.96069       17.23792       19.32135       13.172         10.14166     

The first number is the block number, and each of the subsequent numbers is average EMG for channels 1 - 8.

Now the > button was clicked in Review#3 to move it on to the next block, then OK was pressed again, resulting in a second set of numbers.

The Macro window at this stage showed as follows. Macro Record was turned off by clicking the Record button.


The macro was then edited to include the words ‘for’ and ‘next’ above and below the last two lines. Care was taken to ensure that there was a space at the beginning of each line, and at least one empty line at the bottom. The macro now read

 Review#2, 75 ' mean
 Review#3, 51 ' button 4 OK
 Review#3, 53 ' button 3 >
 Review#3, 51 ' button 4 OK

(note that the following line is clipped)

The macro was then saved using Macro menu, File, Save macro as. in the name HESS1

At this stage the analysis was complete. The macro could now be run by clicking Run in the macro window or using TM, Macro, Run macro. When it was run, it produced a complete line of data for each block. The results could then be saved using Results menu, File, Save Results. The location of the file produced was either the \CPI folder or the raw data folder, depending on the setting of the last option in TM, Options. Results produced for the test data are as follows:

 1              11.84448       13.78595       7.942627       13.96069       17.23792       19.32135       13.172         10.14166     
 2              7.596985       13.40118       7.899353       15.52942       18.1767        26.47229       18.26306       14.8222      
 3              9.748779       19.20551       9.062744       13.56995       10.98877       26.78113       15.44836       13.70667     
 4              7.770325       10.98358       8.122986       8.002563       10.15314       18.85046       11.91779       9.349365     

The measurement program originally used to collect data was as follows: Note that marker tones were used which had been recorded on a video tape. The audio channel was connected via a Rectifier Integrator to MC16 input no. 9.

 $measure emg bio2 address 1 hires
 $measure emg bio2 address 2 hires
 $measure emg bio2 address 3 hires
 $measure emg bio2 address 4 hires
 $measure emg bio2 address 5 hires
 $measure emg bio2 address 6 hires
 $measure emg bio2 address 7 hires
 $measure emg bio2 address 8 hires
 $measure mc16 address 9 "AUDIO"
 $rate 20

 goto MAIN