Page 7 of 9

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 12 May 2024, 08:06
by mellinger
What module is the GDF file where you have fixed it already? Maybe you can share it
It must be fixed in all source modules you use. Currently, that is SoundcardSource (recent already) and gUSBampSource which you may download at
http://bci2000.org/tmp/gUSBampSource.exe
Btw.. last question. Is there a limit of electrodes one can use to amplify linearly to say control a cursor or peripheral? Like 32 electrodes or 64 electrodes is the limit?
There is no such limit in principle. Practically, the most dense EEG sensor grid I'm aware of has 256 electrodes (or channels) (Electrical Geodesics, EGI). Another practical limit comes from the amount of degrees of freedom in the spatial filter to be computed, because they grow with the square of the number of electrodes, and must be determined from example data ("training data"). So, a spatial filter for 64 electrodes roughly requires 4 times as much training data as one for 32 electrodes. When doing EEG experiments, you will notice that it's a rather boring task for the subject especially at the beginning when there is no control. This puts a practical limit on how much training data you will be able to collect.

My suggestion is to start out with 16 electrodes which should be sufficient for mu rhythm experiments. If cost is a factor, you could also do with 8 electrodes if you choose the locations well.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 12 May 2024, 09:43
by whwilbur
mellinger wrote: 12 May 2024, 08:06
What module is the GDF file where you have fixed it already? Maybe you can share it
It must be fixed in all source modules you use. Currently, that is SoundcardSource (recent already) and gUSBampSource which you may download at
http://bci2000.org/tmp/gUSBampSource.exe

The gUSBAmpSource.exe link above doesn't work, file not found.

I bought a used g.USBamp because I read a researcher using it. But when i googled it. It seemed many companies used gtec. I can't find another brand as common as it (or even one to compare it to). What is another (other) brand that many research centers also use? I can't find anything much in google. I want to know if they are as noisy as the g.USBamp at 1000Hz. Most eeg used only 256Hz bandwidth which is clean. The higher the bandwidth, the more white noise. Maybe all 1000Hz bandwidth bio-amplifier are as noisy. What are 16 channel EEG brands most often used in BCI2000? So I have options in case I can't afford the $7000 for gtec 16 pcs of electrodes only.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 12 May 2024, 13:49
by mellinger
The gUSBAmpSource.exe link above doesn't work, file not found.
Sorry, the link is fixed now.
So I have options in case I can't afford the $7000 for gtec 16 pcs of electrodes only.
I don't think you get a better EEG amplifier than the gUSBamp for your purposes. Most other systems supported by BCI2000 are either really expensive clinical systems, or rather simple mobile systems connecting over serial connection or Bluetooth. The BrainProducts vAmp might come close to the gUSBamp.

Note that you don't need to use the expensive dry electrodes with the gUSBamp. You may as well use rather cheap Ag/AgCl electrodes in conjunction with an EEG cap (which I strongly recommend). Dry electrodes will pick up quite some additional noise, whereas wet electrodes, when applied properly, will have a low impedance, resulting in a good SNR.
https://www.cnsac-medshop.com/cnsac-sil ... -pcs-copy/
Googling for "EEG cap" you find caps for around 300 USD, there are typically 3 sizes, make sure you get one that fits your subject.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 15 May 2024, 01:21
by whwilbur
Hi I was trying to use BipolarChLlist but I couldn't get it to work propety.

Image

I put the following command in the gUSBamp.prm parameter file

"Source:gUSBampSource float BipolarChList 2 3 4 5 6 7 8 1"

I also used

"Source:gUSBamp float BipolarChList 2 3 4 5 6 7 8 1"

I even changed to both "int" and "float".

Before I added the above command in parameter file. I plugged the V+ of my Netech EEG simulator output to channel 2, and the V- output to channel 3. Ground to Ground. Reference not connected since the V- to Reference is connected to channel 3. This is to apply the Bipolar mentioned in t he wiki instead of Referential measurements.

All references are not connected. So the reference are floating causing the waveforms not to be uniform. Connecting all references would make the waveforms cleaner. But the point is the Bipolar measurements. The following is before the command "Source:gUSBamp float BipolarChList 2 3 4 5 6 7 8 1" was inserted in the parameter file.

Image

After the command was inserted. The parameter file was reset all to auto and 256 even when they have other values like 4800, why?

Image

after changing back to 4800 sampling and other values which the command line reset to default . it looks like this:

Image

The output doesn't look right because channel 3 was supposed to be deducted to channel 2 or channel 2 - channel 3 for Bipolar mode.

I have to go to g.USBamp Demo to set the Bipolar with Channel 2 - Channel 3 where after it is quit. It is retained for ordinary BCI2000 Launcher to display it like this:

Image


How do you make this work " Source:gUSBampSource float BipolarChList 2 3 4 5 6 7 8 1"? Thanks.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 15 May 2024, 17:02
by mellinger
How do you make this work " Source:gUSBampSource float BipolarChList 2 3 4 5 6 7 8 1"? Thanks.
The correct form is

Code: Select all

 Source:gUSBampSource float BipolarChList= 8 2 3 4 5 6 7 8 1
Note the number of entries is prepended to the list. Also, the equals sign must immediately follow the parameter name.

You can use the Operator config dialog to modify parameters, it's much easier than writing raw parameter definitions.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 15 May 2024, 19:54
by whwilbur
mellinger wrote: 15 May 2024, 17:02
How do you make this work " Source:gUSBampSource float BipolarChList 2 3 4 5 6 7 8 1"? Thanks.
The correct form is

Code: Select all

 Source:gUSBampSource float BipolarChList= 8 2 3 4 5 6 7 8 1
Note the number of entries is prepended to the list. Also, the equals sign must immediately follow the parameter name.

You can use the Operator config dialog to modify parameters, it's much easier than writing raw parameter definitions.
BipolarChList is not in any of the Operator config dialog or I could have just used it. Is it possible just like the SignalType, it was also removed before from Source by other team member somehow?

Putting the command line in the parameter file doesn't work. I get this output with my V+ connected to channel 2 and V- connected to channel 3

Image

It should look like the following since the bipolar pair is substracting channel 2 from channel 3 (setting inputted in g.USBamp Demo but retained in memory where BCI2000 could use it. Channel 2 or 3 is not showing the right waveform above without the gtec sofware setting it first (which produces the right waveform below).. Note the Netech produces big waveform at V+ an V- and the output that comes out is small value (where they subtract V+ from V- which the the g.USBAmp DEMO setting and display shows correctly even when relayed to BCI2000)

Image

I put the command line in the bottom of the following (even just using Source:gUSBamp)) just to test, but it doesn't work either. Also the screen that comes out is the 8 channel like above. How come without the equal sign, the output is 16 channels with DEV1Ch wording at the window. Should the 16 come out also by using the one with equal sign. Whatever, the output doesn't work (see above). I tried it many times with different combinations.


"Source:gUSBamp int AcquisitionMode= 0 0 0 2 // data acquisition mode: 0: analog signal acquisition, 1: calibration signal, 2: impedance measurement (enumeration)
Source:gUSBamp int CommonGround= 0 0 0 1 // internally connect GNDs from all blocks: 0: false, 1: true (enumeration)
Source:gUSBamp int CommonReference= 0 0 0 1 // internally connect Refs from all blocks: 0: false, 1: true (enumeration)
Source:gUSBamp int EnableDigitalInput= 0 0 0 1 // enable digital inputs (boolean)
Source:gUSBamp int EnableDigitalOutput= 0 0 0 3 // enable digital output on block acquisition: 0: off, 1: use expressions %28after signal acquisition%29, 2: timing test, 3: use expressions %28before signal acquisition%29 (enumeration)
Source:gUSBamp matrix DigitalOutputEx= 0 { Expression } // Matrix of Expressions for digital output
Source:gUSBamp int DetectDataLoss= 0 0 0 1 // use gUSBamp counter mode to detect data loss (boolean)
Source:gUSBamp int NumBuffers= 2 5 2 % // IO queue length
Source:Buffering int SourceBufferSize= 2s 2s % % // size of data acquisition ring buffer (in blocks or seconds)
Source:gUSBamp list DeviceIDs= 1 auto // list of USBamps to be used (or auto)
Source:gUSBamp string DeviceIDMaster= auto // deviceID for the device whose SYNC goes to the slaves
Source:gUSBamp intlist SourceChList= 1 auto // list of channels to digitize, in terms of physical inputs numbered across all devices
Source:gUSBamp intlist SourceChDevices= 1 8 // number of digitized channels per device
Source:gUSBamp int FilterEnabled= 1 1 0 1 // Enable pass band filter (0=no, 1=yes)
Source:gUSBamp float FilterHighPass= 0.5 0.1 0 50 // high pass filter for pass band
Source:gUSBamp float FilterLowPass= 1000 60 0 4000 // low pass filter for pass band
Source:gUSBamp int FilterModelOrder= 8 8 1 12 // filter model order for pass band
Source:gUSBamp int FilterType= 1 1 1 2 // filter type for pass band (1=BUTTERWORTH, 2=CHEBYSHEV)
Source:gUSBamp int NotchEnabled= 1 1 0 1 // Enable notch (0=no, 1=yes)
Source:gUSBamp float NotchHighPass= 58 58 0 70 // high pass filter for notch filter
Source:gUSBamp float NotchLowPass= 62 62 0 4000 // low pass filter for notch filter
Source:gUSBamp int NotchModelOrder= 4 4 1 10 // filter model order for notch filter
Source:gUSBamp int NotchType= 1 1 1 2 // filter type for pass band (1=CHEBYSHEV, 2=BUTTERWORTH)
Source:gUSBampSource float BipolarChList= 8 2 3 4 5 6 7 8 1"


Here the BipolarChList is not in any Operator Config dialog

Image

Image

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 16 May 2024, 09:37
by mellinger
BipolarChList is not in any of the Operator config dialog or I could have just used it. Is it possible just like the SignalType, it was also removed before from Source by other team member somehow?
You are right, it has been removed. Generally speaking, if a parameter is not present in the Operator config dialog, it will have no effect if you put it into a .prm file.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 16 May 2024, 11:11
by whwilbur
mellinger wrote: 16 May 2024, 09:37
BipolarChList is not in any of the Operator config dialog or I could have just used it. Is it possible just like the SignalType, it was also removed before from Source by other team member somehow?
You are right, it has been removed. Generally speaking, if a parameter is not present in the Operator config dialog, it will have no effect if you put it into a .prm file.
Oh no. The Bipolar mode was the most noise free. Here is why. In the following for example. You can't short the unused inputs in say channel 2 to 4 of bank 1. In opened inputs the waveforms look like this:

Image

Image

When you short the channel 2 to 4 and connect it to ground. You get these waveforms:

Image

Image

Why does one get those waveforms in channel 2 to 4? It's because even if you don't short the unused channel 2 to 4 inputs to reference. The reference is referred to all 4 inputs in bank one. So for channel 2 you get this V+ - V- = 0 - V- that is. There is still V- and this is so for the unused channel 2 to 4. So it is still showing V- in channel 2 to 4, introducing noises. (Btw.. in all my waveforms the past messages. It's always 10uV (microvolt) 50Hz. the large waveform is because Netech use large amplitude V+ and large amplitude V- to get tiny 10uV.)

Now when you use bipolar and short say V+ to channel 2 and V- to channel 3, and then short all the unused channel 1 and 4 to reference and ground. you get a much cleaner unused input noise. This is the only you can short unused inputs, via bipolar mode.

Image

FFT even supported the bipolar being more clean. But I don't want to post the different FFT comparisons now that shows that bipolar connections between channel 2 and 3 has cleaner unused inputs because as you can see the above There is no way to short Channel 2 to 4 if channel 1 is used as V+ with the blue as reference (V-). In bipolar the blue is not used.

I know sequential bipolar montage is not used in BCI2000. However, instead of using 2 3 4 5 6 7 sequentially. You measure only 1 and 2, and 3 and 4, then 5 and 6 in bipolar mode. You don't need to connect them sequentially.

Who removed the Bipolar in BCI2000? Would it be easy to put it back esp the ability to define what channel would be connected to what channel? In the g.USBamp Demo. They have this option to choose any combinations. this would produce the cleanest channels as explained above.

Image

Image

Image

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 16 May 2024, 11:24
by mellinger
Who removed the Bipolar in BCI2000? Would it be easy to put it back esp the ability to define what channel would be connected to what channel? In the g.USBamp Demo. They have this option to choose any combinations. this would produce the cleanest channels as explained above.
It was removed because the same effect may be achieved in software by spatial filtering. On the gtec side, this feature was implemented in software on their DSP anyway.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 16 May 2024, 11:55
by whwilbur
mellinger wrote: 16 May 2024, 11:24
Who removed the Bipolar in BCI2000? Would it be easy to put it back esp the ability to define what channel would be connected to what channel? In the g.USBamp Demo. They have this option to choose any combinations. this would produce the cleanest channels as explained above.
It was removed because the same effect may be achieved in software by spatial filtering. On the gtec side, this feature was implemented in software on their DSP anyway.
What software and spatial filterIng? You mean other sofware besides BCI2000? What other software besides the $5000 g.recorder? This is no other open source that can display gtec waveforms. So you mean if I want to use bipolar. It has to be the $5000 g.recorder?

In the following specs:

Image

There is the

Input channels: 16 mono/ 8 bipolar

Why didn't they write "16 differential" .. it's as if it's either design as 16 channel mono.. or 8 bipolar (or differential). So the only differential mode may be the bipolar? How do you interpret that part of the spec?

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 16 May 2024, 12:13
by mellinger
What software and spatial filterIng?
BCI2000, for example, using its SpatialFilter component: https://www.bci2000.org/mediawiki/index ... tialFilter

The gUSBamp has 16 inputs with positive amplification, and 4 reference inputs with negative amplification. It always measures the differences between positive inputs, and associated reference. If you switch to "bipolar", it will simply take the difference between two inputs with positive amplification not in hardware but in DSP software.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 16 May 2024, 16:49
by whwilbur
mellinger wrote: 16 May 2024, 12:13
What software and spatial filterIng?
BCI2000, for example, using its SpatialFilter component: https://www.bci2000.org/mediawiki/index ... tialFilter

The gUSBamp has 16 inputs with positive amplification, and 4 reference inputs with negative amplification. It always measures the differences between positive inputs, and associated reference. If you switch to "bipolar", it will simply take the difference between two inputs with positive amplification not in hardware but in DSP software.
By DSP software did you the firmware in chip inside unit or software in PC that has DSP?

If Bipolar has no negative amplification, it is not a true differential like V+ and V-? no Common mode rejection? but why is it cleaner than using normal mode using the blue V-?

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 17 May 2024, 04:21
by whwilbur
whwilbur wrote: 16 May 2024, 16:49
mellinger wrote: 16 May 2024, 12:13
What software and spatial filterIng?
BCI2000, for example, using its SpatialFilter component: https://www.bci2000.org/mediawiki/index ... tialFilter

The gUSBamp has 16 inputs with positive amplification, and 4 reference inputs with negative amplification. It always measures the differences between positive inputs, and associated reference. If you switch to "bipolar", it will simply take the difference between two inputs with positive amplification not in hardware but in DSP software.
By DSP software did you the firmware in chip inside unit or software in PC that has DSP?

If Bipolar has no negative amplification, it is not a true differential like V+ and V-? no Common mode rejection? but why is it cleaner than using normal mode using the blue V-?
The above facts disturbed me, about the possibility there is no Common Mode Rejection. So I googled for hours. And yes the following seems to prove there is none indeed. It just perplexed me. How can a $30,000 complete system lacks even a basic ingredient that even a %5 instrumentation or differential amplifier possesses. Common Mode Rejection? Many R&D centers bought even $50000 to $100000 of gtec products. But it contains no Common mode rejection or true differential amplifier that every novice knows.

In EEG measurements where 16 channels were used. What applications really use Unipolar and Bipolar? Is the reason because most just use unipolar even in clinical or hospital setting that doesn't require any differential input or common mode rejection? It's good I learn this because what is the use of buying the g.GAMMAbox (see below) and dozens of active electrodes and software costing some $8000 when it doesn't even have any true differential bipolar. There are only 4 references (V-) but there is no way to even short the other inputs like channel 2 to 4 as I detailed earlier. Brainmaster has 16-channel EEG which uses differential inputs with common mode rejection with same price as the g.USBamp in the $16000 range. So how did gtec get away with the g.USBamp lacking fundamental features yet selling thousands of units to major research centers and universities? Maybe advertisements? Lastly. What is the competition or alternative to the g.USBamp but with all 16 channels having true differential input? In the following the gtec g.BSamp with true differential inputs were faced out or discontinued in 2015. Maybe gtec thinks it can get away with the DSP based unreal Bipolar with no common mode rejections?

Below it quotes: "Bipolar derivations have the advantage of suppressing noise and artifacts very well, so that only local brain activity near the eletrodes is picked up". This is only true for one like the discontinued g.BSamp that used them. It should have added. "The g.USBamp lacking any true bipolar derivations have the disadvantage of promoting noise and artifacts very well. so that distant noises far from local brain activity far from the electrodes is picked up". With that. I may sell my g.USBamp. Lol.

Image

Image

Image

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 17 May 2024, 10:55
by mellinger
If Bipolar has no negative amplification, it is not a true differential like V+ and V-?
V+ and V- denote a differential amplifier's positive and negative supply voltage, not the inputs.
The above facts disturbed me, about the possibility there is no Common Mode Rejection.
Of course there is common mode rejection between the positive input, and the negative input (reference).
Common Mode Rejection denotes the ability of the amplifier to cancel input voltages that are applied to both positive and negative input. For an ideal amplifier, this is always the case, for a real amplifier, it does not cancel any more as the common mode voltage approaches V+ or V- because a real amplifier cannot be linear in that case any more.

The gUSBamp has a very large input range due to its 24bit AD converter (144dB). Thus, it is possible to have large values on two positive inputs against reference, and cancel them in software which effectively is a form of Common Mode Rejection as well.

The gUSBamp is a very good amplifier but measuring EEG is not easy to do, so you need to be patient.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 17 May 2024, 15:46
by whwilbur
mellinger wrote: 17 May 2024, 10:55
If Bipolar has no negative amplification, it is not a true differential like V+ and V-?
V+ and V- denote a differential amplifier's positive and negative supply voltage, not the inputs.
The above facts disturbed me, about the possibility there is no Common Mode Rejection.
Of course there is common mode rejection between the positive input, and the negative input (reference).
Common Mode Rejection denotes the ability of the amplifier to cancel input voltages that are applied to both positive and negative input. For an ideal amplifier, this is always the case, for a real amplifier, it does not cancel any more as the common mode voltage approaches V+ or V- because a real amplifier cannot be linear in that case any more.

The gUSBamp has a very large input range due to its 24bit AD converter (144dB). Thus, it is possible to have large values on two positive inputs against reference, and cancel them in software which effectively is a form of Common Mode Rejection as well.

The gUSBamp is a very good amplifier but measuring EEG is not easy to do, so you need to be patient.
I mean In+, In-. kind of typo. But the gUSBamp doesnt have any instrumentation amplifier so its In+, Reference In- may not have common mode rejection. Ill ask the electronic engineers in the net if it is possible to have common mode rejection without using any instrumentation amplifier chip..And how to produce common mode signal to test if it really has it. I want to test if the red and blue reference really has it. But if you can share any article proving it has common mode rejection. Please share it.

For the DSP bipolar. There isnt any hardware common mode rejection. But thanks for letting me know it is possible to cancel common mode in software. It gave me hope some experiments done using the g.Usbamp is real. Bec if it is real. It can change everything, expand our view of the universe and more.

Many EEG uses Unipolar like in BCI applications. Here is it also possible to cancel common mode in software? And what software do you use to cancel common mode?