TOBI SignalServer  0.1
tobiss::EEGSimulator Class Reference

A class to simulate EEG signals. More...

#include <eeg_simulator.h>

+ Inheritance diagram for tobiss::EEGSimulator:
+ Collaboration diagram for tobiss::EEGSimulator:

Public Member Functions

 EEGSimulator (boost::asio::io_service &io, ticpp::Iterator< ticpp::Element > hw)
 Constructor.
virtual ~EEGSimulator ()
 Destructor.

Private Member Functions

virtual void generateSignal ()
 Implementation of the abstract method creating the signals (sine and EEG).
void setHardware (ticpp::Iterator< ticpp::Element >const &hw)
 Set the configuration of the SineGenerator with a XML object.
virtual void setDeviceSettings (ticpp::Iterator< ticpp::Element >const &father)
 Set configuration listed in the <device_settings> section in the XML file.
virtual void setChannelSettings (ticpp::Iterator< ticpp::Element >const &father)
 Set configuration listed in the <channel_settings> section in the XML file.
void setPort (ticpp::Iterator< ticpp::Element >const &elem)
 Set the port number used to remote control the EEGsimulator.
void setDeviceEEGConfig (ticpp::Iterator< ticpp::Element >const &elem)
 Set the configuration of the EEG signal from the device configuration section.
void setDeviceSineConfig (ticpp::Iterator< ticpp::Element >const &elem)
 Set the configuration of the sine waves from the device configuration section.
void setChannelEEGConfig (ticpp::Iterator< ticpp::Element >const &father)
 Set the configuration of individual EEG signals from the channel settings section.
void setChannelSineConfig (ticpp::Iterator< ticpp::Element >const &father)
 Set the configuration of individual sine waves from the channel settings section.
void checkEEGConfigAttributes (ticpp::Iterator< ticpp::Element >const &elem)
 Check if all arguments from the EEG config are OK.
void checkSineConfigAttributes (ticpp::Iterator< ticpp::Element >const &elem)
 Check if all arguments from the sine config are OK.
EEGSimMsgParser::EEGConfig getEEGConfig (ticpp::Iterator< ticpp::Element >const &elem)
 Get an EEGConfig object out of the XML node.
EEGSimMsgParser::SineConfig getSineConfig (ticpp::Iterator< ticpp::Element >const &elem)
 Get a SineConfig object out of the XML node.
void handleAsyncRead (const boost::system::error_code &ec, std::size_t bytes_transferred)
 NOT IMPLEMENTED YET! (Handle incomming network packets asynchronously.)
void acceptHandler (const boost::system::error_code &error)
 NOT IMPLEMENTED YET! (Accept handler handling incomming connections.)
void updateEEGConfig (std::map< boost::uint16_t, EEGSimMsgParser::EEGConfig > &eeg)
void updateSineConfig (std::multimap< boost::uint16_t, EEGSimMsgParser::SineConfig > &sine)
void setSineConfigInMultimap (boost::uint16_t ch, EEGSimMsgParser::SineConfig config)

Private Attributes

boost::mt19937 twister_
boost::normal_distribution eeg_dist_
boost::variate_generator
< boost::mt19937
&, boost::normal_distribution<> > 
eeg_gen_
boost::asio::ip::tcp::acceptor acceptor_
boost::asio::ip::tcp::socket socket_
boost::uint32_t port_
std::string peer_ip_
bool connected_
boost::asio::streambuf message_buffer_
std::string str_buffer_
std::map< boost::uint16_t,
EEGSimMsgParser::EEGConfig
eeg_config_
std::multimap< boost::uint16_t,
EEGSimMsgParser::SineConfig
sine_configs_
 <ch_nr, EEGCfg>
EEGSimMsgParser parser_
 <ch_nr, SineCfg>

Static Private Attributes

static const
HWThreadBuilderTemplateRegistrator
< EEGSimulator
factory_registrator_
static const std::string xml_eeg_sim_port_
static const std::string xml_eeg_config_
static const std::string xml_sine_config_
static const std::string xml_scaling_
static const std::string xml_offset_
static const std::string xml_frequ_
static const std::string xml_amplitude_
static const std::string xml_phase_

Detailed Description

A class to simulate EEG signals.

This class is writtern to provide a very basic EEG simulator based on creating normal distributed noise. It provides the possibility to increase the amplitude of this noise or add an offset to it. Additionally it is possible to and sine waves (frequency, amplitude and phase adjustable) to the simulated EEG. This can be applied to every channel individually while running using network communication.

Todo:

If needed: Provide the possibility to change the source-distribution during runtime.

Define and implement a configuration protocol.

Write an EEG simulator based on filtering rather than on adding just a Sine.

Definition at line 75 of file eeg_simulator.h.


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables