Skip to content

Commit a0d3a19

Browse files
committed
Remove invert signal functionality
1 parent 13893bb commit a0d3a19

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

applications/heartbeat_ecg.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
import pylsl
88
import neurokit2 as nk
99
import sys
10-
import argparse
1110

1211
class ECGMonitor(QMainWindow):
13-
def __init__(self, invert=False): # Add the invert parameter
12+
def __init__(self):
1413
super().__init__()
15-
self.invert = invert
1614

1715
self.setWindowTitle("Real-Time ECG Monitor") # Set up GUI window
1816
self.setGeometry(100, 100, 800, 600)
@@ -84,10 +82,6 @@ def update_plot(self):
8482

8583
filtered_ecg = filtfilt(self.b, self.a, self.ecg_data) # Filter the signal
8684

87-
# Invert the signal if the invert flag is set
88-
if self.invert:
89-
filtered_ecg = -filtered_ecg
90-
9185
self.ecg_curve.setData(self.time_data, filtered_ecg) # Use current buffer for plotting
9286

9387
# Detect R-peaks and update heart rate
@@ -124,12 +118,7 @@ def plot_r_peaks(self, filtered_ecg):
124118
self.r_peak_curve.setData(r_peak_times, r_peak_values) # Plot R-peaks as red dots
125119

126120
if __name__ == "__main__":
127-
parser = argparse.ArgumentParser(description="Real-Time ECG Monitor")
128-
parser.add_argument("--invert", action="store_true", help="Invert the ECG signal plot")
129-
130-
args = parser.parse_args()
131-
132121
app = QApplication(sys.argv)
133-
window = ECGMonitor(invert=args.invert) # Pass the invert flag
122+
window = ECGMonitor()
134123
window.show()
135124
sys.exit(app.exec_())

0 commit comments

Comments
 (0)