ELEcro

ELEcro

ELEcro is a simple tool for viewing electrophysiological data. We created this tool to analyze data from our TMSi polygraphy equipment. ELEcro can read and write data in TMS32 (.S00), EDF (.EDF) and BraiVision Analyzer file formats (.VHDR). The strength and weakness of this software is its simplicity. It is very fast, but only has the features that we routinely need for our study.

Getting started


Simply launch ELEcro and use the File/Open command to open your data. You can use the menus and time slider to view your data. There are also a couple of shortcuts:

  • Mouse scroll wheel: increases or decreases the vertical scale.
  • Up/Down arrows: increases or decreases the vertical scale.
  • Left/Right arrows: scrolls the time period.
  • Ctrl-H/Ctrl-Alt-H: increases or decreases the horizontal scale.
  • Home/End: go to first or last samples
  • Mouse right-click plus dragging: pans the viewing window.
  • Moving the mouse over the image generates text on the left side of the image showing the time sample and signal levels at the location selected.
ELEcro

Acquiring data


You will want to use your polygraph hardware to collect data. ELEcro imports EDF, TMS32 and BrainVision Analyzer format data. If your hardware does not support these formats, you can often translate formats using the Biosig toolbox for Matlab/Octave. Alternatively, if you have TMSi hardware, you can try our own EMG recorder to acquire data – this will save data as either TMS32 or BrainVision format.

Analyzing data


Modern wireless polygraphic systems allow great mobility, and safety when using other devices (such as transcranial magnetic stimulation). However, it is possible for some of the signals to be dropped, due to radio frequency noise or the computer processing other tasks. For this reason, the TMSi Mobi system generates a ‘Saw’ signal (an additional simulated channel that shows a saw-shaped signal). ELEcro allows you to observe this Saw channel, and future versions will provide a tool to interpolate across these samples.

A common first step for analyzing electrophysiological data is to apply temporal filters. Polygraphic data often has noise from the environment, particularly for mobile units. For example, the alternating current in a buildings wires can cause noise (50-60 Hz depending on your country). The signals also have low frequency drift as the electrode contact changes, as well as high frequency noise. A high-pass filter will remove low-frequencies, whereas a low-pass filter eliminates the high-frequency information. The next paragraphs ELEcro’s temporal filtering options.

Choose “Low Pass Filter” from the “Tools” menu to apply a Butterworth 4th order low pass filter. You will be asked to specify the frequency limit for you want to use. Note that the filter has considerable roll-off, so if you have sharp 50 Hz noise and want to eliminate this noise and all lower frequencies, try a high pass filter with ~60 Hz (the Tools/GenerateSineWaves command can be applied before a temporal filter to gauge this roll-off). ELEcro will only apply the filter to the physical electrodes, the trigger and saw signals will not be altered. This filter is run in both directions to prevent temporal bias. The pictures on this web page show how the filter can selectively remove frequencies (simulated data).

The Tool’s menu “Filter…” allows you to design one of the filters described by Robert Bristow-Johnson. A window allows your to specify several features of your filter:

  • Type: This specifies the kind of filter to apply. Your options are Low Pass, High Pass, Band Pass CSG, Band Pass CZPG, Notch, All Pass, Peaking, Low Shelf and High Shelf. A low pass filter attenuates signals above the target frequency, a high-pass filter dampens signals below the target, band pass filters dampen all frequencies except those near the target, an all pass filter amplifies or dampens all frequencies evenly (though it influences phase), a peak filter preserves all frequencies but amplifies those near the target frequency, shelf filters preserve all frequencies, but somewhat increases or decreases frequencies below (low shelf or above (high shelf) the target frequency.
  • Hz: Specify target frequency. Center Frequency or Corner Frequency, or shelf midpoint frequency, depending on filter type.
  • Gain dB: Used only for peaking and shelving filters. These filters pass all frequencies, but will increase or decrease the intensity of the target frequencies by this amount.
  • Q: By default, this value specifies the Quality factor, tuning the selectivity of the filter. However, if “Q is bandwidth” is checked, this value sets the bandwidth in octaves.
  • Q is bandwidth: See above.
  • Filter both forward and reverse: Many filters cause shift signals such that they appear to occur later in time. Running the filters in both directions minimizes this effect.

Clinicians often link their Electromyography (EMG) systems into audio amplifiers. Human auditory perception has great temporal resolution, and clinicians can often hear subtle differences in EMG recordings that are hard to detect by examining a visual plot. To the uninitiated, EMG sounds like rain hitting a metal roof, but these sounds are often important for medical diagnosis. Therefore, the Tools menu for the Windows version of ELEcro includes the ‘Audio’ command, that allows you to listen to a segment of your EMG recording.

ELEcro

Averaging across events

Event files tell the software when different stimuli were presented to the participant. This allows us to generate average waveforms to see what signals are consistent following events. There are actually three steps to averaging the data. First, we need to open or create a new event file that logs the onset and type of each event. Second, we want to visually inspect these events to ensure that each event was a clean recording. Third, we want to create averages for each event type for each channel.

First we need to open or generate an events file. ELEcro can read and write BrainVision VMRK files – these files mark the time and type of events that occur. Choose Events/Open to open an existing file. If you want to generate a new event file, first choose File/Open to open the phsyiological data and then Events/New to specify the settings for detecting events. We typically want to average from multiple conditions, for example looking at hand movements following weak versus strong pulses of brain stimulation. The TMSi Mobi includes a optical trigger for recording this data, but this only generates a binary signal (on or off), which makes it difficult to distinguish between interleaved events of multiple conditions. To deal with this, you can vary the length of your optical triggers during recording, with the duration of the trigger pulse specifying the condition type. After collecting the data, ELEcro can parse the events based on the stimulus duration. This explains why the Events/New settings window is slightly complicated:

  • Trigger channel: which channel is used as the trigger signal. Typically, TMSi computers have a binary channel named ‘digi’, but you could also use one of the analog channels.
  • Threshold: A trigger is counted whenever the input exceeds this integer value. Values larger than zero are easy to understand (e.g. 7 means that any time the signal increases such that it exceeds 7 a trigger event will be generated). The value zero is used for a threshold of 0.5 (useful for binary signals that cycle between zero and one), whereas negative values are for power(10,n), e.g. -2 is 0.01.
  • Pulse width threshold (ms): this is used if different conditions are specified by different trigger durations. For example, if one condition uses a 5ms pulse, and the other uses 15ms, the value 10 will optimally discriminate these values.
  • Ignore start/end (ms). We typically discrad any events that occur near the start or end of the recording. In particular, the first events will be contaminated by our temporal filtering. The final events will also be contaminated if we ran the filter in both forward and reverse directions.

Visually inspecting event files is easy with ELEcro. When you open a VMRK file, a panel appears at the bottom of ELEcro that allows you to navigate through the events. In the figure above, we are seeing the 12th of 203 events, which was of type “Stimulus” and with the description “Cond1″ – the onset of this event was the 123427th sample and it lasted 100 samples. A gray box on the graph shows the onset of this event. You can use the < and > buttons to proceed to the previous and next event, and the – button to delete this event (for example if there was an artifact and you do not want to include this event in the analysis).

The standard steps for generating an average are as follows:

  1. Use File/Open to open your physiological data.
  2. Use Events/Open to open your Events file (this will happen automatically if there is a VMRK file with the same name as your physiological data).
  3. Visually inspect the events to exclude unusual trials (you can use Events/Save to save the inspected event file).
  4. Choose Events/Average to choose the settings for your average:
    • Start (ms): specify the onset time of the averaging relative to the trigger singal. For example, if you choose -15, then the averaged file will commence 15ms prior to the trigger signal.
    • Duration (ms): specifies the number of time bins averaged. For example, if you chose a start of -15 and a Duration of 100, the average file will include samples from -15 to 85ms relative to the trigger signal.
    • Rectify: The absolute value for each sample will be used. This is only useful for bipolar EMG data.

The figure shows averaging using the defaults settings applied to the simulated data ELEcro creates when it starts (and shown in the other images). Note that channel C4 has two digital triggers, which both occur at 10 Hz (just like the slowest signal), but are out of phase with each other. After averaging, there are 50-51 (’_51′) trials averaged for each condition, and the fundamental frequencies are clear, with the phase shift clear for our two triggers (though channels C1 and C2 would have looked cleaner if we ran a 25-Hz low pass filter first to remove noise not in phase with our triggers).

Computing statistics


Once you have filtered and averaged your data, you can export the files for analysis with Excel, Open office, or your favorite statistics package. The File/Export command saves the data as tab-delimited text. Note that this software follows electrophsyiological convention of using the dot instead of the comma as a decimal separator (e.g. writing 7.2 instead of 7,2). The software that imports your data should be set up for this format (often you can adjust the Regional settings in your control panel).

Downloads

Links

  • EDFbrowser is an elegant free tool for viewing EDF, EDF+ and BDF format electrophysiological data. It includes many powerful features, and is much more powerful than ELEcro. Further, the current version of ELEcro assumes your EDF data is pretty simple (like generated with TMSi hardware), whereas EDFbrowser can read much more complicated data (for example, with annotation or with channels that have different sampling rates).
  • Some code is based on Michael Vinther’s EEG Analyzer. His free software has many powerful features.
  • The Butterworth filter was adapted by Jean-Pierre Moreau
  • EMG recorder is a simple tool for collecting EMG data that can subsequently by analyzed with ELEcro.
  • My Biquad Filters web page is an interactive demonstration of the high pass, low pass and notch filters available in ELEcro.
  • The Twente Medical Systems International Mobi is the EMG system we use. This battery powered unit is able to communicate wirelessly (using bluetooth) or it can simply record data to a standard SD flash memory card.
  • Temporal filtering notes for electrophysiological data.
  • Systematic study of the use of low-pass filters for EMG recording.
  • Here are details for the European Data Format (EDF and EDF+).
  • Biosig toolbox for Matlab/Octave supports a huge number of electrophysiological data formats, and can be useful for converting between projects.
  • The open source EEGLAB matlab scripts are popular for analyzing electrophysiological data.