You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+61-48Lines changed: 61 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,27 +28,21 @@ Chords Python script is designed to interface with an Arduino-based bioamplifier
28
28
## Installation
29
29
30
30
1. Ensure you have Python 3.x installed.
31
-
2. Install the required Python libraries:
31
+
2. Create Virtual Environment
32
+
```bash
33
+
python -m venv venv #Create Virtual Environment
34
+
.\venv\Scripts\activate #to activate environment
35
+
3. Install the required Python libraries:
32
36
```bash
33
37
pip install -r requirements.txt
34
38
```
35
39
36
40
## Usage
37
41
38
42
To use the script, run it from the command line with various options:
39
-
40
-
First Create Virtual Environment
41
-
42
-
```bash
43
-
python -m venv venv #Create Virtual Environment
44
-
.\venv\Scripts\activate #to activate environment
45
-
```
46
-
Then,
47
-
48
43
```bash
49
44
python chords.py [options]
50
45
```
51
-
52
46
### Options
53
47
54
48
- `-p`, `--port`<port>: Specify the serial port to use (e.g., COM5, /dev/ttyUSB0).
@@ -58,72 +52,91 @@ Then,
58
52
- `-v`, `--verbose`: Enable verbose output with detailed statistics and error reporting.
59
53
- `-t`: Enable the timer to run program fora set timein seconds.
60
54
61
-
## Applications
55
+
### Data Logging
62
56
63
-
### GUI
57
+
- **CSV Output**: The script saves the processed data in a CSV file with a timestamped name.
58
+
- The CSV file contains the following columns:
59
+
- `Counter`: The sample counter from the Arduino.
60
+
- `Channel1` to `Channel6`: The data values from each channel.
64
61
65
-
- `python gui.py`: Enable the real-time data plotting GUI.
62
+
- **Log Intervals**: The script logs data counts every second and provides a summary every 10 minutes, including the sampling rate and drift in seconds per hour.
66
63
67
-
### FORCE BALL GAME
64
+
### LSL Streaming
68
65
69
-
- `python game.py`: Enable a GUI to play game using EEG Signal.
[!IMPORTANT] : Before using the below Applications make sure you are in Application folder.
94
94
95
-
Parses data from Arduino and manages logging, streaming, and GUI updates.
95
+
### GUI
96
96
97
-
`init_gui()`
97
+
- `python gui.py`: Enable the real-time data plotting GUI.
98
98
99
-
Initializes and displays the GUI with six real-time plots, one for each bio-signal channel.
99
+
#### Script Functions
100
100
101
-
`cleanup()`
101
+
`init_gui()`: Initializes and displays the GUI with six real-time plots, one for each bio-signal channel.
102
102
103
-
Handles all the cleanup tasks.
103
+
`update_plots()`: Updates the plot data by pulling new samples from the LSL stream and shifting the existing buffer.
104
104
105
-
`main()`
105
+
### FORCE BALL GAME
106
106
107
-
Handles command-line argument parsing and initiates data processing.
107
+
- `python game.py`: Enable a GUI to play game using EEG Signal.
108
108
109
-
## Data Logging
109
+
#### Script Functions
110
110
111
-
- **CSV Output**: The script saves the processed data in a CSV file with a timestamped name.
112
-
- The CSV file contains the following columns:
113
-
- `Counter`: The sample counter from the Arduino.
114
-
- `Channel1` to `Channel6`: The data values from each channel.
111
+
Here are the important functions from your Pygame script summarized in one line each:
115
112
116
-
- **Log Intervals**: The script logs data counts every second and provides a summary every 10 minutes, including the sampling rate and drift in seconds per hour.
113
+
`bandpower(data, sf, band, window_sec=None, relative=False)`: Calculates the band power of EEG data in a specified frequency band using the Welch method.
117
114
118
-
## LSL Streaming
115
+
`eeg_data_thread(eeg_queue)`: Continuously retrieves EEG data from an LSL stream and computes power ratios for Player A and Player B.
0 commit comments