Eeg Report
Eeg Report
REPORTS
PROJECT
COURSE: BACKGROUND OF COMMUNICATION
TOPIC: EEG DATA PROCESSING AND APPLICATION
TABLE OF CONTENTS
I. Introduction……………………………………………………………………2
II. Experimental setup…………………………………………………………….3
III. Procedure………………………………………………………………………4
IV. Results…………………………………………………………………………5
V. Conclusion……………………………………………………………………..9
School of Electrical & Electronic Engineering
2
I. INTRODUCTION
The study of brain waves and their characteristics has led to advancements in various
fields. Researchers and scientists utilize EEG technology to analyze brain wave patterns
and their correlations with specific mental states, cognitive functions, neurological
disorders, and overall brain health. This knowledge has practical applications in areas
such as neurofeedback therapy, brain-computer interfaces, sleep research, meditation
training, and diagnosing conditions like epilepsy and sleep disorders.
- Alpha Waves:
Frequency: 8-12 Hz
Characteristics: Alpha waves are associated with a relaxed, calm, and meditative state.
They are often observed when you close your eyes and let your mind wander.
Example: During a state of relaxation, such as when you're taking a break, practicing
mindfulness, or engaging in creative activities, your brain generates alpha waves.
- Theta Waves:
Frequency: 4-8 Hz
School of Electrical & Electronic Engineering
3
Characteristics: Theta waves are associated with deep relaxation, daydreaming, and
light sleep. They play a role in creativity, intuition, and accessing the subconscious
mind.
Example: When you are in a state of deep relaxation, engaging in meditation,
experiencing vivid dreams, or accessing deep-seated memories, theta waves are
prominent.
- Delta Waves:
Frequency: 0.5-4 Hz
Characteristics: Delta waves are the slowest brain waves and are primarily observed
during deep sleep. They are crucial for restorative processes, physical healing, and
regenerating the body.
Example: When you are in a state of deep sleep or unconsciousness, delta waves
dominate your brain activity.
- Gamma Waves:
Frequency: 30-100 Hz (and even higher)
Characteristics: Gamma waves are the fastest brain waves and are associated with high-
level cognitive processes, information binding, and conscious awareness.
Example: During intense focus, heightened perception, deep meditation, or moments of
insight and inspiration, gamma waves are prevalent.
2. EEG Recording
2.1. Preparation and electrode placement:
Before the EEG recording session, the participant's scalp is prepared by gently cleaning
the area and removing any oils or residues that may interfere with the electrode-skin
interface.
School of Electrical & Electronic Engineering
4
Electrodes, typically made of metal or conductive gel, are placed on specific locations
on the scalp according to the international 10-20 system. These locations are determined
based on standardized distances relative to specific anatomical landmarks on the head.
The number and configuration of electrodes used can vary depending on the study's
requirements or the specific brain regions of interest.
The amplifier system typically consists of differential amplifiers, which measure the
voltage differences between pairs of electrodes, and a common reference electrode that
serves as a stable voltage reference point.
The amplified signals are then digitized using an analog-to-digital converter (ADC) to
convert the continuous analog signals into discrete digital samples. The sampling rate
determines how many samples per second are taken, typically ranging from 128 to 1000
samples per second.
• Preparation
- Arduino Uno
- Neurosky Mind Link
- Module Relay
- 5V Power
- Electrical components: led, wires, resistors…
III. PROCEDURE
School of Electrical & Electronic Engineering
6
- All the signals are combined, including the brain wave signals and the various noise
sources, to create the random EEG data.
- The initial plot is set up to display the random EEG data with noise.
- The code enters a loop where the EEG data is shifted to create a running EEG wave
effect. The plot is continuously updated to show the running effect.
- The EEG data is written to a file named 'RandomData.txt' as it is being generated.
- Finally, the file is closed, and a message is displayed indicating that the running
EEG data with additional noise has been saved to the file.
School of Electrical & Electronic Engineering
7
- Defines a function called verifySerialPort that checks if a serial port exists and is available.
+ Checks if the specified port name exists in the list of available ports.
+ If the port exists, sets portExists to true and displays a message indicating that the port is
available.
+ If the port does not exist or is not available, sets portExists to false and displays a message
indicating that the port is not available.
- Calls the verifySerialPort function to check the availability of the specified port.
- Assigns the port name (/dev/cu.usbmodem14101) and a baud rate (9600) to the variables
arduinoPort and baudRate, respectively.
- Calls the setupSerial function to set up the serial port communication with the specified port
and baud rate.
- Reads EEG data from a file (eeg.txt) using the fopen and textscan functions.
+ Reads the numeric data from the file into the variable rawEEGData using the textscan
function.
- Sets parameters for the filter: sampling frequency (fs), low cutoff frequency (lowCutoff), and
high cutoff frequency (highCutoff).
School of Electrical & Electronic Engineering
9
- Designs a bandpass filter using the Butterworth filter design (butter) and obtains the filter
coefficients (b and a).
- Filters the rawEEGData using the filtfilt function to obtain the filteredEEGData.
- Sets up the initial plot for the filtered and normalized EEG data.
- Sends the brain wave data through the serial port and updates the plot to create a running
effect.
+ Rounds the value to an integer and sends it as brain wave data through the serial object.
+ Updates the plot by shifting the data to create the running effect.
- Clears the serial object to close the serial port communication when finished.
- Defines a function called setupSerial that sets up the serial port communication.
IV. RESULTS
- Random EEG data
School of Electrical & Electronic Engineering
11
VI. CONCLUSION
• Strengths:
The scripts are modular and well-organized, with clear separation of tasks into
different functions.
User feedback is provided at each step, enhancing usability and troubleshooting.
The dynamic updating of the plot provides a real-time visualization of the EEG data.
• Improvements:
- Error Handling:
Add more comprehensive error handling, especially for file I/O and serial
communication, to make the script more robust.
Check if the file exists before attempting to read it.
- Parameter Configuration:
Allow additional serial port configuration parameters (e.g., data bits, stop bits, parity)
for greater flexibility.
- Code Modularity:
Further modularize the code by breaking down the EEG data processing steps into
smaller functions.
- Efficiency:
Optimize the dynamic plot update by avoiding unnecessary data shifts and updates.