Skip to content

Commit 6565f35

Browse files
committed
Update Readme acc to new changes done in script
1 parent 3dd23e7 commit 6565f35

File tree

1 file changed

+8
-42
lines changed

1 file changed

+8
-42
lines changed

README.md

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
# Chords - Python
22

3-
Chords Python script is designed to interface with an Arduino-based bioamplifier, read data from it, optionally log this data to CSV or stream it via the Lab Streaming Layer (LSL), and visualize it through a graphical user interface (GUI) with live plotting.
3+
Chords Python script is designed to interface with an Arduino-based bio-potential amplifier, read data from it, optionally log this data to CSV or stream it via the Lab Streaming Layer (LSL), and visualize it through a graphical user interface (GUI) with live plotting.
44

55
> [!NOTE]
66
> Flash Arduino code to your hardware from [Chords Arduino Firmware](https://github.com/upsidedownlabs/Chords-Arduino-Firmware) to use this python tool.
77
88
## Features
99

1010
- **Automatic Arduino Detection:** Automatically detects connected Arduino devices via serial ports.
11-
- **Data Reading:** Read ModularEEG P2 format data packets from the Arduino's serial port.
11+
- **Data Reading:** Read data packets from the Arduino's serial port.
1212
- **CSV Logging:** Optionally logs data to a CSV file.
1313
- **LSL Streaming:** Optionally streams data to an LSL outlet for integration with other software.
1414
- **Verbose Output:** Provides detailed statistics and error reporting, including sampling rate and drift.
1515
- **GUI:** Live plotting of six channels using a PyQt-based GUI.
16+
- **Invert:** Optionally Invert the signal before streaming LSL and logging
1617
- **Timer:** Record data for a set time period in seconds.
1718

1819
## Requirements
@@ -101,61 +102,26 @@ To use the script, run it from the command line with various options:
101102
102103
- `python gui.py`: Enable the real-time data plotting GUI.
103104
104-
#### Script Functions
105-
106-
`init_gui()`: Initializes and displays the GUI with six real-time plots, one for each bio-signal channel.
107-
108-
`update_plots()`: Updates the plot data by pulling new samples from the LSL stream and shifting the existing buffer.
109-
110105
### FORCE BALL GAME
111106
112107
- `python game.py`: Enable a GUI to play game using EEG Signal.
113108
114-
#### Script Functions
115-
116-
`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-
118-
`eeg_data_thread(eeg_queue)`: Continuously retrieves EEG data from an LSL stream and computes power ratios for Player A and Player B.
119-
120-
`reset_game()`: Resets the game state and initializes the ball and player forces.
121-
122-
`update_ball_position(force_player1, force_player2)`: Updates the ball's position based on the net force exerted by both players.
123-
124-
`check_win_condition()`: Determines if either player has won based on the ball's position.
125-
126109
### HEART RATE
127110
128111
- `python heartbeat.ecg.py`:Enable a GUI with real-time ECG and heart rate.
129112
130-
#### Script Functions
131-
132-
`butter_filter(cutoff, fs, order=4, btype='low')`: Designs a Butterworth filter to remove unwanted frequencies from the ECG signal.
133-
134-
`apply_filter(data, b, a)`: Applies the designed Butterworth filter to the ECG data for noise reduction.
135-
136-
`detect_heartbeats(ecg_data, sampling_rate)`: Detects heartbeats in the ECG signal using peak detection.
137-
138-
`run(self)`: Collects ECG data from the LSL stream, applies filtering, and emits the filtered data for real-time plotting.
139-
140-
`update_plot(self, ecg_data)`: Updates the plot with the latest ECG data and detects heartbeats to display on the GUI.
141-
142-
`update_heart_rate(self)`: Calculates and updates the heart rate based on detected R-peaks in the ECG signal.
143-
144113
### EMG ENVELOPE
145114
146-
- `python emgenvelope.py` :Enable a GUI with real-time EMG & its Envelope.
147-
148-
#### Script Functions
149-
150-
`update_plot` : Updates the plot with latest Filtered EMG Data and its Envelope.
115+
- `python emgenvelope.py`: Enable a GUI with real-time EMG & its Envelope.
151116
152117
### EOG
153118
154-
- `python eog.py` :Enable a GUI with real-time EOG.
119+
- `python eog.py`: Enable a GUI with real-time EOG that detects the blinks and mark them with red dot.
120+
121+
### EEG
155122
156-
#### Script Functions
123+
- `python ffteeg.py`: Enable a GUI with real-time EEG data with its FFT.
157124
158-
`update_plot` : Updates the plot with latest Filtered EOG Data.
159125
160126
## Troubleshooting
161127

0 commit comments

Comments
 (0)