Unit for Recording External Events during Measuring of Biosignals

1 Abstract —The development of new computing and classification algorithms recognizing patterns in electroencephalographic (records still presents new knowledge related to functions of such a complex system as the human brain. Many workplaces occupy themselves with the processing of electroencephalographic signals. They solve mainly the issues of the detection epileptic states, Brain Computer Interface, or the detection of evocated potentials initiated by various stimuli (the light, sound, movement, etc.). As the duration of the brain reaction to a given stimulus range within tens of milliseconds, it is necessary to record the event as precisely as possible. The main aim of this paper is to describe a universal device which is able to record external stimuli during the measurement of the electroencephalographic. The designed device contains of a set of sensors and can be used with different measurement systems. The main advantages of this system are the universality, the short reaction time and the ability of recording several stimuli simultaneously.

1 Abstract-The development of new computing and classification algorithms recognizing patterns in electroencephalographic (records still presents new knowledge related to functions of such a complex system as the human brain.Many workplaces occupy themselves with the processing of electroencephalographic signals.They solve mainly the issues of the detection epileptic states, Brain Computer Interface, or the detection of evocated potentials initiated by various stimuli (the light, sound, movement, etc.).As the duration of the brain reaction to a given stimulus range within tens of milliseconds, it is necessary to record the event as precisely as possible.The main aim of this paper is to describe a universal device which is able to record external stimuli during the measurement of the electroencephalographic.The designed device contains of a set of sensors and can be used with different measurement systems.The main advantages of this system are the universality, the short reaction time and the ability of recording several stimuli simultaneously.Index Terms-Brain computer interface, trigger circuit, electroencephalography.

I. INTRODUCTION
Evoked potentials (EP) mean changes in the electric brain activity initiated by a deliberate external stimulus.These signals are superposed on the spontaneous brain activity and their detection and precise interpretation are relatively complicated.Measuring of evoked potentials is used, for example, in the rain Brain Computer Interface (BCI) area.Various workplaces focus, for example, on the detection of limb movements [1]- [3], the brain reaction to a sound stimulus [4], [5] or to a light stimulus [6].
In the course of the electroencephalographic (EEG) signals analysis and the EP detection, we must conduct stimulation repeatedly and in this way gain a set of a large number of brain reactions to a specific external stimulus.It is thus necessary to know the exact timing and the kind of the stimulus which caused the evoked potential.It is important that the event timing is synchronised with the measured EEG signal.This article describes a BioTrigg device recording these events.

II. THE ISSUE DESCRIPTION
There are more approaches to event recordings during the EEG measuring.It is often possible to transmit the timing mark via the digital bioamplifier interface or the electroencephalograph.However, this depends on the device type, its producer or the utilised type of the communication protocol.Also, only the time of the occurring event can be marked.However, this way is not precise enough.The most precise method is the saving of event marks through one of the measuring amplifier's channels.In this way, we ensure the similar signal delays as existing with the measured signal.The resulting timing mark is synchronised with the measured data.As one measuring channel is utilised for the event recording, we cannot use it for the EEG measuring.Also, we need to differentiate the occurring stimulus kind.The information on the stimulus kind is shown, in our situation, by the impulse amplitude.Each stimulus presents itself in the recording as an impulse of defined amplitude.The resulting signal indicates the information about the occurring event time and kind.It also allows for the recording of concurrent events taking place one after another in a short time interval.

III. SYSTEM DESIGN
In the course of EP measuring, we need to register movement, a light stimulus, a sound stimulus, and the pushbutton pressing.Individual events are recorded by suitable sensors.They are connected in circuits evaluating the measured value and they shape the output signals at the same time.The individual signals are then led to interrupting inputs of a microcontroller (MCU).The evaluation and generation of a rectangle impulse lasting for 100 ms and the amplitude 5 V at the relevant MCU output take place on the basis of individual events.The individual signals at the MCU outputs are then attenuated to the level of millivolts and weighted in order to show clearly the kind of occurring event.The output voltage occurs by summing up individual events and this signal is taken to one of the bioamplifier channels.

A. Sensor Part
The sensor part and entry terminals for individual signal sources.
There is a digital accelerometer (ADXL345, Analog Devices, USA) [7] used for the movement evaluation.It is connected via the I2C bus and a single interrupting signal [8].The accelerometer data are filtered by digital filter which is embedded and programmed in the ADXL345 circuit.Cut off frequency of the lowpass filter is 6.25 Hz and the output data rate is 12.5 Hz.This sensor features the interruption source.The interruptions are automatically generated when the sensor acceleration exceeds, in one axis of the three, the programmed value.The acceleration value is set to 1.25 g.We have found this threshold value experimentally and it corresponds to a deliberate limb movement.After the initialising of the interruption, the sensor can generate another impulse only after a second.This deadband ensures that the accelerometer does not generate false interruptions.There is the automatic initialisation and the required function programmed after the accelerometer was connected with the device.In the course of measuring, signs of interruption are zeroed by the I2C bus.The time from the interruption initialisation to the sign zeroing corresponds with the deadband.Experimentally, this time was set at one second.However, it might be reprogrammed to a different value and use the device, in this way, also for other applications, not only the recording of limb movements (e.g. the detection of epileptic seizures).When the accelerometer is disconnected, its initialisation stops.That is ensured by the automatic detection circuit or by the disconnection of the accelerometer.
There is a phototransistor (L-93DP3C, Kingbright, Taiwan) used for the detection of a light stimulus.The phototransistor reacts to changes of light conditions in the space.The phototransistor is connected in such a way that only a light flashing from the EEG photo stimulator causes the interruption.
The device features a single integrated push button, but it might be connected to another external push button.There is a terminal allowing connection of the signal generating an impulse by a sound stimulus to headphones.

B. Analogue Circuits
The analogue part ensures the connection of sensors in a circuit and their correct functioning.It also ensures the shaping and amplifying of signals to become suitable for the initialisation of interruptions in MCU.
The phototransistor is connected in the voltage divider and the signal from the optical sensor is filtered by an active lowpass filter with the limiting frequency of 1.6 kHz and the amplification 10.The filter has been designed in such a way that it allows only passing of the rising edge of the flashing duration.That ensures the independency of other light sources (flashings by fluorescent lights or by other sources of slow light changes).The interruption is generated synchronously with each flashing start from the photostimulator.
The rectangle or sinusoidal duration and the frequency up to 10 kHz and the changeable prevailing time can be used for the sound stimulation.The sound can be generated, for example, in a computer and the BioTrigg is connected with the terminal of a sound card through a HUB.The router allows also connection with headphones serving for the sound stimulation.There is a one-sided envelope of the stimulating signal created for the detection of this event start (Fig. 2).This ensures the independency of the duration shape of the stimulating impulse or of the duration time of the sound stimulus.
The push buttons are connected in the voltage divider with the lowpass filter suppressing flickers.

C. Digital Part
To ensure the maximum precision of interruption detection, we use a microcontroller (ATMega2560-16AU, Atmel, USA) featuring eight independent sources of external interruption.Each pin of the external interruption is connected with one of the sensors or intake terminals initiating an event.The timing of the impulse duration, generated for each event separately, is ensured by an independent timer.MCU features four 16 bit and two 8 bit timers [9].The big differentiation ability is ensured by the working MCU frequency of 16 MHz.The operation of the timers' interruption zeros only the output of the given event.

D. Weighting Circuit
Five digital MCU outputs represent five events which can take place.MCU generates impulses with the amplitude of 5 V and the prevailing time of 100 ms.This voltage must be then weighted to differentiate the event kinds and attenuated to the values of millivolt units.Then, the individual signals are summed up.The result is only a single analogue signal led to one of the intake terminals of the bioamplifier.The values, to which the individual signals are weighted, are unique.Their sum is also unique and it occurs only by a specific combination of individual events.This allows us to differentiate the current events and their current combinations.
The output MCU voltage is adjusted by the divider to a required value and the individual voltages are then summed up with the assistance of the connected non-inverting summing amplifier (Fig. 3).The individual voltage values 0 u and an example of combinations are presented in Table I.
For example, when the combination of the sound stimulus and the pressing of the external push-button occurs, the output of both impulses superposition indicates, at the time when they overlap, the maximal voltage 16 mV + 4 mV = 20 mV.

IV. BIOTRIGG IMPLEMENTATION
A prototype of the device was designed and realized with the stress put on its practical utilisation.The device is fed from a 9 V battery and the ground is connected with the ground of the bioamplifier.The device was realized on a double-sided board of the printed circuit.The arrangement of the circuits is illustrated in Fig. 4. The accelerometer is connected with the device via a miniDIN6 connector and other sensors are connected via JACK 3.5.The device is placed in a box (13 cm × 6.5 cm × 2.8 cm) and supplemented with a switch and a power indicator (Fig. 5).
BioTrigg is connected with the amplifier via standard connectors in the same way as the EEG electrodes.

V. MEASURING AND TESTS
The reaction time of the trigger was measured between the start of the stimulus and an impulse which was generated by the trigger unit and this value is 1.25 ± 0.21 ms in all channels.The test was performed by bioamplifier (g.BSamp, g.tec, Austria) with rate 4800 Hz.The changes in the brain electrical activity caused by an external stimulus take tens of milliseconds [10].The obtained reaction time is short against required timing.
BioTrigg was tested during EEG measuring with the bioamplifier g.BSamp.The sampling frequency of all channels was 256 Hz -the satisfactory value for the square signal reconstruction.In the course of measuring, there was the filtration of the 50 Hz noise from power public.Figure 6 illustrates EEG durations from the three selected leads and one duration with timing marks.The sound stimulation was executed with the assistance of the sinusoidal signal with the frequency of 1 kHz and the duration of 500 ms.The light stimulation was conducted randomly with the assistance of an EEG photo stimulator.The patient was asked during the experiment to push down the push button randomly.During the experiment, there were recordings taken which were then processed by the MATLAB software (Fig. 6).BioTrigg allows recording of concurrent events or of more different events taking place one after another in short time intervals.When two events take place at the same time, the impulses at the output are summed up for both events.Whereas the individual levels and their sums are unique, we can always safely identify which specific events took place (Fig. 7).
The threshold identification of timing marks allows for the automatic event detection and the further data segmentation.In this way, we gain a set of EEG recordings occurring as the reactions to specific stimuli, during a single uninterrupted measuring.There has been a script for the automatic threshold identification, segmentation and signal classification, by the timing marks from the BioTrigg device, created in the MATLAB software.

VI. CONCLUSIONS
The BioTrigg device is a small portable trigger powered by 9 V battery.It is the suitable peripheral device of the bioamplifier or the electroencephalograph in the area of the EEG research focussed on evoked potentials.The device designed by us does not depend on any producer.The voltage values of signals are selected in such a way that they may be used with all common bioamplifiers or electroencephalographs.BioTrigg allows noticing of movements, a light stimulus, a sound stimulus, or pressing the push-button.The device features one integrated pushbutton, while another external one might be also connected.
Reaction time of the device is 1.25 ms in all channels.The device was tested and verified in real conditions with satisfactory results.As an example of the real utilisation of the BioTrigg device in practice, we present the duration of the auditory evoked potential (AEP), which we gained by averaging of our measured data (Fig. 8) [11].
The alternative utilisation of the device exists when measuring reaction times related to one of the stimuli.We can detect either the simple reaction time, when we measure the motoric reaction to the stimulus, or the recognition reaction time thanks to the existence of the two pushbuttons, when the patient must assess the received stimulus and press one of the push-buttons depending on the stimulus kind.This device is very useful in the clinical practice, especially with patients suffering of the Parkinson disease when we assess their reaction speed to the given stimulus [12].
Manuscript received February 28, 2013; accepted June 14, 2013.The work and the contributions were supported by the project SV SP 2013/35 "Biomedical engineering systems IV".The paper has been elaborated within the framework of the IT4Innovations Centre of Excellence project, Reg.No. CZ.l.05/1.1.00/02.0070supported by the Operational Programme "Research and Development for Innovations" funded from the Structural Funds of the European Union and the state budget of the Czech Republic.

Fig. 2 .
Fig. 2. The image a) shows the sound stimulating impulse of the frequency 1 kHz and the prevailing time 500 ms and 1 second (blue) and the onesided signal envelope (red).The image b) illustrates the output signal by BioTrigg.

Fig. 3 .
Fig. 3. Connection of the weighting part and the summing up item.

Fig. 6 .
Fig. 6.The example showing the three EEG recordings and timing marks of events caused by different stimuli.The kind of the stimulus and the time of the event occurrence might be recognised on the image.

Fig. 7 .
Fig. 7.The example of individual event impulses.The image illustrates also concurrent events.It is always possible to recognise which event took place on the basis of the selected voltage values of the impulse.

Fig. 8 .
The duration of the evoked potential caused by the sound stimulus, which was created by averaging 100 durations of EEG from the Cz lead.

TABLE I .
OUTPUT VOLTAGES FOR EACH STIMULI.