0% found this document useful (0 votes)
18 views15 pages

Eeg Report

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views15 pages

Eeg Report

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

HA NOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

SCHOOL OF ELECTRICAL & ELECTRONIC ENGINEERING

REPORTS
PROJECT
COURSE: BACKGROUND OF COMMUNICATION
TOPIC: EEG DATA PROCESSING AND APPLICATION

Instructor: Assoc.Prof. Nguyen Van Duc


Students:
1. Tran Minh Ha – 20224309
2. Bui Thi Ngoc Anh – 20224276
3. Cu Minh Anh – 20224277
Class: 149242

Hanoi University of Science and Technology


No 1 Dai Co Viet Road, Hanoi, Vietnam
School of Electrical & Electronic Engineering
1

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

1. General introduction to brain wave


1.1. Definition and significance of brain waves
Brain waves are natural electrical activities in the brain that can be measured using
electroencephalography (EEG) techniques. They reflect the electrical activity of
neurons in the brain and can be classified into different types based on their frequency
and patterns of activity.

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.

1.2. Major types of brain waves


- Beta Waves:
Frequency: 12-30 Hz (cycles per second)
Characteristics: Beta waves are associated with active thinking, problem-solving,
concentration, and alertness.
Example: When you are engaged in a conversation, working on a task that requires
focus, or actively thinking and analyzing information, your brain is likely producing
beta waves.

- 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.

2.2. Signal acquisition and amplification:


EEG electrodes are connected to an amplifier system that measures and amplifies the
tiny electrical signals detected from the scalp.

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.

2.3. Recording Components


- TGAM, open BCI, Neurosky Mind Link: Convenient, accurate, expensive.
- AD8232: usually use for ECG, low price, low accuracy.
School of Electrical & Electronic Engineering
5

II. EXPERIMENTAL SETUP

• Preparation
- Arduino Uno
- Neurosky Mind Link
- Module Relay
- 5V Power
- Electrical components: led, wires, resistors…

• Connection and Circuit

III. PROCEDURE
School of Electrical & Electronic Engineering
6

1.Recording EEG Data

• Case 1: Recording data using Neurosky Mind Link


- Using Bluetooth to connect the device to phone
- Open “NeuroSky recording” app to record and save the data

• Case 2: Create/ generate random EEG data using Matlab


- Set the number of data samples and the sampling frequency for the EEG data
- Generate different brain wave signals with different frequency and amplitude, such
as delta, theta, alpha, beta, and gamma waves.
- Create eye movement noise (EOG) and muscle noise (EMG) to simulate additional
noise sources commonly found in EEG recordings.
- Create environmental noise, which is low-frequency noise.

- 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

2. Read and Process EEG data

- Defines a function called verifySerialPort that checks if a serial port exists and is available.

+ Retrieves a list of available serial ports using the serialportlist function.

+ Displays the list of available serial ports.

+ 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.

- Assigns a port name (/dev/cu.usbmodem14101) to the variable portName.

- Calls the verifySerialPort function to check the availability of the specified port.

- Displays a message indicating whether the port is available or not.

- 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.

+ Creates a serial object using the serialport function.

+ Configures the termination character of the serial communication.

+ Flushes any existing data in the serial buffer.

+ Displays a message indicating that the serial port is set up.


School of Electrical & Electronic Engineering
8

- Reads EEG data from a file (eeg.txt) using the fopen and textscan functions.

+ Opens the file for reading.

+ Reads the numeric data from the file into the variable rawEEGData using the textscan
function.

+ Closes the file.

- Converts the rawEEGData from a cell array to a numeric array.

- 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.

- Normalizes the filteredEEGData to a 0-100 range.

- 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.

+ Iterates over each data point in the normalizedEEGData.

+ 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.

+ Shows the data being sent through the serial port.

+ Pauses for a short duration to visualize the changes.

- Clears the serial object to close the serial port communication when finished.

- Defines a function called setupSerial that sets up the serial port communication.

+ Creates a serial object using the serialport function.

+ Configures the termination character of the serial communication.

+ Flushes any existing data in the serial buffer.

+ Displays a message indicating that the serial port is set up.


School of Electrical & Electronic Engineering
10

• Upload code to Arduino

IV. RESULTS
- Random EEG data
School of Electrical & Electronic Engineering
11

- Mind Link Recorded Data


School of Electrical & Electronic Engineering
12

- Light Turn on if sending data>30


School of Electrical & Electronic Engineering
13
School of Electrical & Electronic Engineering
14

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.

You might also like