Skip to content

Commit ea24c5e

Browse files
authored
Merge pull request #85 from James-Mc1ntyre/master
Added comments for how to implement Nonin 3231 USB as recording device for the HRD task
2 parents 659b0c7 + c414d7a commit ea24c5e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

cardioception/HRD/parameters.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,10 @@ def getParameters(
383383
serial=port, sfreq=75, add_channels=1, **systole_kw
384384
)
385385
parameters["oxiTask"].setup().read(duration=1)
386+
387+
# # for Nonin 3231 USB
388+
# parameters['oxiTask'] = Nonin3231USB(serial=port, add_channels=1).setup().read(1)
389+
386390
elif setup == "test":
387391
# Use pre-recorded pulse time series for testing
388392
port = serialSim()

cardioception/HRD/task.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,14 @@ def trial(
444444
# Only use the last 5 seconds of the recording
445445
bpm = 60000 / np.diff(np.where(peaks[-5000:])[0])
446446

447+
448+
# # for Nonin3231USB
449+
# # Only use the last 5 seconds of the recording
450+
# bpm = pd.Series(parameters["oxiTask"].read(duration=5.0).bpm)[-5:]
451+
# # use bpm as signal, Nonin3231USB gives no raw signal
452+
# signal = bpm
453+
454+
447455
print(f"... bpm: {[round(i) for i in bpm]}")
448456

449457
# Prevent crash if NaN value

0 commit comments

Comments
 (0)