BCI 2000 Recovering Frequency Sweep + Auto Delete

This forum deals with BCI2000 configuration issues.
Post Reply
blange
Posts: 3
Joined: 04 Jan 2025, 12:33

BCI 2000 Recovering Frequency Sweep + Auto Delete

Post by blange » 04 Jan 2025, 12:59

I'm attempting to recover a frequency sweep from a gTec USB Amp recording. The stimulation source is generating sin waves with progressively higher frequencies starting at 1 and progressing at integer increments. Much appreciated, if someone could point me in the right direction for a few of these challenges:
1. I can see the output dat file while the session is in progress, but when I quit the session, this file gets auto deleted. Is there a setting to persistantly record output?
2. The default format appears to be a dat file, can I make it generate an EDF? When I specified edf, no file was generated.
3. The signal I'm generating is a clean sin wave. I can verify it's a clean sign wave with my DMM. In the BCI2000 gui, I'm seeing the tops of the crests chopped off. I've attempted to turn off any filtering as you can see below. Is there something else to try to get a clean answer?
4. The Sampling Rate of 256 sets a fairly low bar for frequency recovery. I'm attempting to generate a signal at 40000 Hz. When I set this value higher, I appear to get timeouts in the log messages. What's the upper bound of this recording sampling rate?
5. There's an option Detect Data Loss, how do I use this option if I'm recording from a gUSB Amp.
6. Maybe I want to try an Acquisition Mode of Calibration, how do I make that happen.

Environment:
BCI 2000 ver 3.6.7385
gUSB Amp: UR 2019 05 04
Stimulation source connected to channel 1 and ground connected on group A's yellow ground DIN.

I start the BCI 2000 with the following batch file:
"D:\BCI2000\BCI2000 v3.6.beta.R7385\BCI2000.x64\batch\CursorTask_gUSBamp.bat"

Source Configuration Tab:
SourceCh: 1
Sample Block Size: 1
Sampling Rate: 256
Channel Name: <blank>
SourceChOffset: 0
Source Ch Gain: 1
Aquisition MOde: analog signal aquisition
common ground: true
Comon Reference: true
enable digital input: <unchecked>
enable digital output: use expressions (after signal aquisition)
Digital output Ex: <default>
Detect Data Loss: <unchecked>
NumBuffers: 2
Device IDs: auto
Device ID Master: auto
SourceChList: auto
SourceChDevices: 1
Filter Enabled: 0
Filter High Pass: 0
Filter Low Pass: 60
Filter Model Order: 8
Filter Type: 1
Notch Enabled 0
Notch High Pass: 58
Notch Low Pass: 62
Notch Model Order: 4
NOtch Type: 1
Source Buffer Size: 2s
Align Channels: unchecked
SourceChTimeOffset: <empty>
TransmitChList: *

Storage Configuration Tab:
DataDirectory: ../data
DataFile: ${SubjectName}${SubjectSession}/${SubjectName}S${SubjectSession}R${SubjectRun}.${FileFormat}
SubjectName: test
SubjectSession: 001
Subject Run: 01
ID_System: <blank>
ID_Amp: <blank>
ID_Montage: <blank>
StorageTime: <blank>
FileFormat: dat
FileSplittingCondition: <blank>

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: BCI 2000 Recovering Frequency Sweep + Auto Delete

Post by mellinger » 04 Jan 2025, 15:50

1. I can see the output dat file while the session is in progress, but when I quit the session, this file gets auto deleted. Is there a setting to persistantly record output?
Click "Start" in the Operator window.
2. The default format appears to be a dat file, can I make it generate an EDF? When I specified edf, no file was generated.
EDF does not support 32 bit data as required by the g.USBamp. You can try GDF, though.
3. The signal I'm generating is a clean sin wave. I can verify it's a clean sign wave with my DMM. In the BCI2000 gui, I'm seeing the tops of the crests chopped off. I've attempted to turn off any filtering as you can see below. Is there something else to try to get a clean answer?
Your signal might exceed the input range of the g.USBamp (+/-5V, IIRC).
4. The Sampling Rate of 256 sets a fairly low bar for frequency recovery. I'm attempting to generate a signal at 40000 Hz. When I set this value higher, I appear to get timeouts in the log messages. What's the upper bound of this recording sampling rate?
The maximum sampling rate for the g.USBamp is 38kHz IIRC. For higher sampling rates, you will need to increase the SampleBlockSize parameter proportionally with the sampling rate (so it results in the same block duration). Otherwise, the system cannot keep up with the frequent data updates.
5. There's an option Detect Data Loss, how do I use this option if I'm recording from a gUSB Amp.
Just switch it on. It will use the g.USBamp's last channel (#8 or #16, respectively), so that is not available for data acquisition.
6. Maybe I want to try an Acquisition Mode of Calibration, how do I make that happen.
Switch it on and press "Start". You will get a list values in the system log.

blange
Posts: 3
Joined: 04 Jan 2025, 12:33

Re: BCI 2000 Recovering Frequency Sweep + Auto Delete

Post by blange » 06 Jan 2025, 10:53

1. I noticed that the Start button wasn't getting enabled, but the plot seemed to be rendering. When I dig into the log I noticed, the error message below. When I went through and configured 2 channels, I didn't get the error any more, I could click start and had access to the file for the session. Seems weird that I need to record two channels.

Channel specification in
Classifier(2,input channel)=2
is invalid.

Everything else makes sense.

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: BCI 2000 Recovering Frequency Sweep + Auto Delete

Post by mellinger » 06 Jan 2025, 14:32

You don't need to record two channels, you may just change the offending entry of the Filtering->Classifier parameter from 2 to 1.

blange
Posts: 3
Joined: 04 Jan 2025, 12:33

Re: BCI 2000 Recovering Frequency Sweep + Auto Delete

Post by blange » 07 Jan 2025, 13:11

The errors that occur in the config log are a little cryptic. The best path that I've been able to find:
1. Download the BCI 2000 Source code. https://www.bci2000.org/mediawiki/index ... Sourcecode
2. Pick a given error message I was confused by the message "A sampling rate of 30000 Hz does not seem to be supported. Be aware of your limited Karma!"
3. Use a tool like NotePad++ to look through the source code for that error message.

There's a subset of approved sample rates. Make sure you're requesting one of those values.

if ((samplerate != 32) && (samplerate != 64) && (samplerate != 128) && (samplerate != 256) &&
(samplerate != 512) && (samplerate != 600) && (samplerate != 1200) && (samplerate != 2400) &&
(samplerate != 4800) && (samplerate != 9600) && (samplerate != 19200) && (samplerate != 38400))
bciwarn << "A sampling rate of " << samplerate
<< "Hz does not seem to be supported. Be aware of your limited Karma!";

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: BCI 2000 Recovering Frequency Sweep + Auto Delete

Post by mellinger » 08 Jan 2025, 12:33

Thank you for your note.
A shorter path might have been looking up the documentation for the gUSBampADC:
https://www.bci2000.org/mediawiki/index ... mplingRate

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests