Page 6 of 9

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 09 May 2024, 14:35
by mellinger
I thought disabling the grounds of all channels via the software is enough.
You did not disable them, you separated them. The amplifier is still sensitive enough to pick up noise through open inputs/grounds from other inputs, not only the channel you are recording.
When you load them up. How are you supposed to load up the g.USBamp parameter for example? Should you load them up together or only the P3 Speller?
The .bat files contain a line that loads both the gUSBamp related parameter file, and the task related parameter file.
So each batch file loads all required parameter files.
How many simultaneous channels the most a user can use? I thought it was only one channel. If say 8 channels. How do you use 8 channels to move a cursor??
You record from multiple channels, and then combine them linearly to obtain a single signal that in turn is used to control the cursor. This is similar to the way how a wifi device with multiple antennas combines antenna signals to achieve an optimal SNR in direction of the signal source.
There is an algorithm called CSP (Common Spatial Patterns) that computes optimal weights for this linear combination. It is available in the BCI2000Analysis program.
There are also simpler spatial filters available in BCI2000, e.g. CAR (Common Average Removal) and Laplacian filtering.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 09 May 2024, 17:12
by whwilbur
mellinger wrote: 09 May 2024, 14:35
I thought disabling the grounds of all channels via the software is enough.
You did not disable them, you separated them. The amplifier is still sensitive enough to pick up noise through open inputs/grounds from other inputs, not only the channel you are recording.
When you load them up. How are you supposed to load up the g.USBamp parameter for example? Should you load them up together or only the P3 Speller?
The .bat files contain a line that loads both the gUSBamp related parameter file, and the task related parameter file.
So each batch file loads all required parameter files.
How many simultaneous channels the most a user can use? I thought it was only one channel. If say 8 channels. How do you use 8 channels to move a cursor??
You record from multiple channels, and then combine them linearly to obtain a single signal that in turn is used to control the cursor. This is similar to the way how a wifi device with multiple antennas combines antenna signals to achieve an optimal SNR in direction of the signal source.
There is an algorithm called CSP (Common Spatial Patterns) that computes optimal weights for this linear combination. It is available in the BCI2000Analysis program.
There are also simpler spatial filters available in BCI2000, e.g. CAR (Common Average Removal) and Laplacian filtering.
That's a novel idea. Also is noise reduction from multiple channels also possible? Someone told me "MATLAB (or Octave) can look at all 14 channels (or more) simultaneously and look for the common factor. That common factor is the noise which affects all channels simultaneously, and can be removed from all channels.".

Is it possible to do combined measurement and removal? how do you know which is the noise and signal to increase the SNR or cancel if this would be applied in BCI2000 for example?

Whatever. I think I must invest in the gtec g.GAMMAbox and at least 8 active electrodes to plug into my g.USBamp. This can cost me $4000 or so. I'm looking for a used one for them but couldn't find one in the internet. For the BCI folks here. If you have g.GAMMAbox and active electrodes you don't need anymore please sell them to me at good low price. Just msg me. I need them asap. Thanks.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 10 May 2024, 07:58
by mellinger
That's a novel idea
Not really. CSP was published in the 90's, and Laplacian filtering is an idea from the 80's.
how do you know which is the noise and signal to increase the SNR or cancel if this would be applied in BCI2000 for example?
That's the reason why you do an initial measurement with predefined targets. Then you can analyze the data correlating signal (or signal power) with the target information. Data that correlates highly is signal, data that does not correlate is noise.

It's described in the BCI2000 book and in numerous publications about signal processing in BCIs.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 10 May 2024, 08:58
by whwilbur
mellinger wrote: 10 May 2024, 07:58
That's a novel idea
Not really. CSP was published in the 90's, and Laplacian filtering is an idea from the 80's.
how do you know which is the noise and signal to increase the SNR or cancel if this would be applied in BCI2000 for example?
That's the reason why you do an initial measurement with predefined targets. Then you can analyze the data correlating signal (or signal power) with the target information. Data that correlates highly is signal, data that does not correlate is noise.

It's described in the BCI2000 book and in numerous publications about signal processing in BCIs.
Ok. I shorted all the other inputs from channel 2 to 16 like you suggested and got unexpected surprising result.

Image

This is the image I always saw the past few months before today.

Image

after shorting all inputs and using shorting in sofware all ground and reference. I got this!

Image

It's the same 10uv (microvolt) 50Hz input from Netech. But it's much less noise and bigger too. I had to try it many times thinking it's too good to be true. The Netech amplitude is really 10 microvolt and not higher. With the BCI2000. Before we got this signal from the Netech:

Image

After I shorted it and tried the same 10uV Netech output and True in CommonGround and CommonReference. I got much bigger signal in BCI2000.

Image

Reducing the size produce this very clean image. It's really 10uV and I had to check it many times to be sure it is not higher.

Image

This is the FFT.

Image

Its waveform i better than the BMA-200 now. But I still found it too good to be true. I was wondering if shorting all inputs enabled the oversampling/averaging or other DSP digital processing? Why does the image become bigger? It should still have same amplitude but only cleaner. Yet the amplitude is increased more than 5 times. I asked electronic experts in PSE. And they just closed the topic because it's not supposed to amplify and no one own a $17500 gtec.

Say, in the BCI2000 display. is the amplitude accurate? For example in the much bigger clean waveform. It reads 29uV. The Netech signal is only 10uV and the old dirty waveform is closed to 10uV (see above). So gtec must have done some processing inside if all inputs shorted except channel 1 where the Netech is connected? I need to know why the signal got amplified. I was reading about montage (wondering if its a montage effect) in BCI2000 and the command is not in the parameter or option (BipolarChList). Did you see the same thing in other amplifiers where the signal is amplified when all signal shorted? What's the explanation? Lastly. For those you saw the amplifiers shorted. Are there special leads that can be purchased just to short them. Or do they short it like mine in my original message? Thank you.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 10 May 2024, 10:21
by mellinger
I was wondering if shorting all inputs enabled the oversampling/averaging or other DSP digital processing?
No, it just removed the noise collected by the open inputs.
Did you see the same thing in other amplifiers where the signal is amplified when all signal shorted? What's the explanation?
You might have entered SourceChGain other than 1.0 for example. Also you should not connect you signal generator's minus output to ground (the green one) but the amplifier's minus input (the black one). Ideally, you would also connect the amplifier's ground (green) to some grounded object like a radiator.
For those you saw the amplifiers shorted. Are there special leads that can be purchased just to short them.
There are special plugs that may be plugged on top of each other, and cables made with those plugs. They are useful to short-circuit the open inputs.
https://www.ternimed.de/Jumper-and-adapter-cable-black (you get them in other colors, too, so you can keep the overview over your cabling).

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 10 May 2024, 11:17
by whwilbur
mellinger wrote: 10 May 2024, 10:21
I was wondering if shorting all inputs enabled the oversampling/averaging or other DSP digital processing?
No, it just removed the noise collected by the open inputs.
Did you see the same thing in other amplifiers where the signal is amplified when all signal shorted? What's the explanation?
You might have entered SourceChGain other than 1.0 for example. Also you should not connect you signal generator's minus output to ground (the green one) but the amplifier's minus input (the black one). Ideally, you would also connect the amplifier's ground (green) to some grounded object like a radiator.
For those you saw the amplifiers shorted. Are there special leads that can be purchased just to short them.
There are special plugs that may be plugged on top of each other, and cables made with those plugs. They are useful to short-circuit the open inputs.
https://www.ternimed.de/Jumper-and-adapter-cable-black (you get them in other colors, too, so you can keep the overview over your cabling).
I connected my Netech right. The green on top is ground and connected to ground of the g.uSBamp. the red jumper is just connecting the ground to unused inputs 2, 3 and 4 of bank one. The Netech minus is connected to the amplifier minus and plus to the amplifier plus as I have been doing the past few months.

Image

I didn't change the SourceChGain. I didn't change any setting. I was able to prove the settings were the same, because when I unplugged the jumper at the 3rd and 4th banks. The amplitude got back to small size at will. I think the g.USBamp has done some gain if it detects good signal, so amplify it internally. I don't know when gtec chat will be back online. I'll jus ask them about this. Also by simply changing the CommonReference to false and CommonGround to true only with all other settings unchanged with all inputs of channel 2 to 16 shorted with Netech at channel 1. The waveform suddenly got back to normal like this:

Image

So it has got something to do with reference (or the V- in each bank). And remember the waveform also gets bigger at the g.USBamp Demo itself which doesn't have any gain setting. So it is the DSP amplifying the waveform if there is good signal I think. In the following is quoted about the presence of gain inside:

https://www.gtec.at/product/gusbamp-research/

"TEST SIGNAL GENERATION AND CALIBRATION
The g.USBamp RESEARCH amplifier can generate an internal sinusoidal-, rectangular-, sawtooth- or white-noise test signal. The amplitude and frequency of the signal can be modified to test the recording and analysis chain. An internal calibration unit periodically detects offset and gain values for each channel and uses these values for automatic internal correction. This technique yields the highest possible accuracy – especially critical for high resolution EEG and source derivation/localization."

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 10 May 2024, 19:47
by whwilbur
Please see these videos to prove the amplitude can change by connecting or disconnecting by software the CommonGround and CommonReference alone even in sampling as low as 512Hz and not just 1000hz.

I didn't try removing the all the 15 input shorts and putting back in video to avoid ESD. Without shorting any inputs like before. The waveforms were small and noisy even if all is True in CommonGround and CommonReference. It is only when all inputs shorted and all True that the waveforms get cleaner and bigger without changing SourceChGain. However even with all inputs shorted. If you change the CommonGround and CommonReference to False. the waveforms get smaller and noisy. So shorting all inputs is not the only requirements for getting clearer signal but also connecting all grounds and references.

In this youtube demonstration starting with g.USBamp Demo. The waveform is at the default where all of the grounds and references were not shorted (or "false" in BCI2000). The setting is 4800Hz sampling, 5Hz to 1000Hz bandwidth, 60Hz Notch. In all tests the computer and g.USBamp were battery operated and all nearby plugs and equipments turned off. By connecting all the grounds and not the references in the software. The waveforms remained small and noisy. It is only when the references were connected in the video that the waveforms suddenly changed to bigger and cleaner. However, if you just connect all the References and not the ground, the waveforms are half bigger and very noisy.


https://youtu.be/YwHta92mXtI



I did the same thing to BCI2000. In the video start in the following. The CommonGround and CommonReference were set to false. And you can see the waveforms were small and noisy. By simply changing both the CommonGround and CommonReference to "True". The waveforms got bigger (or the scale reading become bigger). How do you fix the scale to say 100uV only. When change to True. It becomes bigger at 700uv. But in my last tests. the scale remains at 90-100uV which makes the waveform bigger when all ground and references set to True in my last message. Note that just like in the g.USBamp tests above. With both CommonGround and CommonReference set to False. Only changing CommonGround to True won''t make it bigger and cleaner. Only by setting CommonReference to True that waveforms get bigger and cleaner.


https://youtu.be/SYWkMkASPx4


Why does the amplitude keeps changing on left side besides the fixed 100uV or 700uV? Is it the moving yellow line depending on which points the amplitude it is scanning?

I changed the sampling to 512Hz in the following video as is commonly used in EEG. Here the initial waveforms were small or original size with Ground and References not connected in the software (but all 15 inputs shorted, from now on, all the 15 inputs will always be shorted). And by connecting all ground and references in the software. The waveforms get bigger too just like in the above tests. So one may not attribute the increase in amplitude to detecting cleaner source. Because in the 512Hz sampling, the waveform was already very clean. The reason 1000Hz sampling is dirty is simply because more bandwidth allows more noise. So what is the theory why connecting both Ground and Reference make the amplitudes bigger??

https://youtu.be/bO5rvFoZTuM

Again. Without shorting the inputs of the 15 unused channels. No changes even if all the grounds or references are connected in both g.USBamp Demo and BCI2000.


Image

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 11 May 2024, 05:22
by mellinger
So what is the theory why connecting both Ground and Reference make the amplitudes bigger??
An EEG amplifier is a differential amplifier, i.e. it amplifies the difference between Reference (negative input) and positive input. If Reference is disconnected, anything can happen, especially picking up of noise, or a diminished signal.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 11 May 2024, 08:34
by whwilbur
mellinger wrote: 11 May 2024, 05:22
So what is the theory why connecting both Ground and Reference make the amplitudes bigger??
An EEG amplifier is a differential amplifier, i.e. it amplifies the difference between Reference (negative input) and positive input. If Reference is disconnected, anything can happen, especially picking up of noise, or a diminished signal.
Ok. But note when I shorted all the inputs of each bank. I shorted the 4 inputs to Reference (and Ground) of each bank. Now when I connected via software all the ground of Bank 1 to Bank 4. It should also connect all References of Bank 1 to Bank 4 since the Ground and Reference of each bank is connected. But without connecting in software all References. The waveforms are not clean. So I guess there may be more complicated things going on. I dont want to use multimeter to test the conductivity of each bank if the software is connecting or disconnecting all physically because I dont want to risk damaging it. So if someone knows the exact details. Just share it here someday. Right now ill focus on plan to using it and not configuring.

Right now im allocating budget to get the $4000 g.GAMMAbox active/passive electrode driver box and 8 active electrodes. But I need to know. Why is 8 the limits of channels in BCI2000? Is it bec of lack of processing power in computer? If I get 10 pcs active electrodes. Only 8 can run in BCI2000? But since the software only relay from source. And if the $5000 gtec g.recorder software can accept 16 channels without slowing down the computer. why cant BCI2000 run 16 channels? Do they have the same system requirements when say using 8 channels? With only 1 channel im already getting lost bytes when moving screen. What system must I get to run 8 channels without lost of data?

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 11 May 2024, 08:58
by mellinger
Why is 8 the limits of channels in BCI2000?
There is no such limit. 8 channels is just the default configuration for the gUSBamp because there are (or used to be) gUSBamps with only 8 channels.
What system must I get to run 8 channels without lost of data?
BCI2000 used to run fine and was recording from the gUSBamps on the weak machines of the 2000's, so I don't think there is a fundamental issue. But it might not be a bad idea to ask someone with a stronger machine just for testing.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 11 May 2024, 15:31
by whwilbur
Wait. Something doesnt look right. Im using channel 1 of Group A below. Are you supposed to connect the Reference (In -) of Group A to the Reference (In-) of the other 3 banks where I shorted all Inputs (V+), Reference (V-) and Ground together? Isnt the effect like shorting the V- and ground of channel 1 while using channel 1 in Group A since the ground of all 4 Groups are also shorted??

Image

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 11 May 2024, 16:03
by mellinger
Are you supposed to connect the Reference (In -) of Group A to the Reference (In-) of the other 3 banks where I shorted all Inputs (V+), Reference (V-) and Ground together? Isnt the effect like shorting the V- and ground of channel 1 while using channel 1 in Group A since the ground of all 4 Groups are also shorted??
No. Instructions for shorting everything applied to the case when you wanted to check for noise.

Just connect every input (except channel 1) to its associated reference. Then, connect all grounds together (by software setting, or using leads). For all channel groups except the first, connect the reference to ground, and make sure there is no internal connection between references (software setting).

Finally, connect your signal generator's + output to channel 1's + input, and the signal generator's - output to channel group 1's reference. If your signal generator has a ground output, connect it to the amplifier grounds.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 11 May 2024, 19:27
by whwilbur
mellinger wrote: 11 May 2024, 16:03
Are you supposed to connect the Reference (In -) of Group A to the Reference (In-) of the other 3 banks where I shorted all Inputs (V+), Reference (V-) and Ground together? Isnt the effect like shorting the V- and ground of channel 1 while using channel 1 in Group A since the ground of all 4 Groups are also shorted??
No. Instructions for shorting everything applied to the case when you wanted to check for noise.

Just connect every input (except channel 1) to its associated reference. Then, connect all grounds together (by software setting, or using leads). For all channel groups except the first, connect the reference to ground, and make sure there is no internal connection between references (software setting).

Finally, connect your signal generator's + output to channel 1's + input, and the signal generator's - output to channel group 1's reference. If your signal generator has a ground output, connect it to the amplifier grounds.
Hope you can include the warning above when setting the default to True in CommonReference in BCI2000 (which is Default to False or disconnected in the Common References at g.USBamp Demo software).

Connecting all References and Grounds and shorting all inputs have the effect of shorting reference and ground in channel 1. Instead of the differential say 9-6 = 3.. you get only 9 because the V- is grounded making it a single ended measurement (not differential anymore), that's why the amplitude got higher. If I didn't use a signal generator and know the output is 10uV instead of the 25uV output displayed (which is only measuring V+ to ground and not deducting V- which is grounded), I won't know the connection is wrong.

So by setting only CommonGround to True and CommonReference to False with all inputs shorted except channel 1. I got back my noisy waveform.

Image

Now the BMA-200 beat it again. Last night I was kinda celebrating thinking I got something better than the BMA (which I was trying to improve for months), then found out today it was all just an illusion. Lol.

By setting the CommonReference to False using the g.USBamp. At least the FFT doesn't have the big 958Hz peak and noises.

Image

In the following is when CommonGround and CommonReferences both set to True using g.USBamp but with no input shorted producing the 958Hz and noisier which seems to be related to connecting all references.

Image

Right now if I set all CommonGround and CommonReferences to True and all inputs shorted, which practically shorts the V- and ground in channel 1. I can't get an FFT because the magnitude of the V+ only signal is so huge.


Btw.. the noises in the 1st FFT above with CommonGround true and CommonReference false and 15 channels input shorted is also present in the BMA-200 in the following BMA FFT. This means the noises are related to the Netech Signal Generator. This was why I wanted to be able to see the BMA in BCI2000 and thanks to the fixed SoundCardSource, It did that.


Image

I have some questions.

1. To move a control in BCI2000. What is the minimum channel required, should it be 8 that's why True is default in CommonReferences? it lead me astray 2 times with the 958Hz peak before and the false V+ only amplitude now. So for those using only one channel. it should be set to False. But can one move a cursor with one channel only?

2. You said "You record from multiple channels, and then combine them linearly to obtain a single signal that in turn is used to control the cursor.". Do you have any figure or table, etc. what is the increase in SNR or amplitude (or other variables) for this combined 8 channel vs 1 channel. I want see comparisons between 8 noisy channel vs 1 clear channel whether it is possible a good amplifier with 1 good channel can equal the 8 noisy channel. Or whether my BMA-200 with clearer 1 channel can equal the 8-channel noisier g.USBamp.

Thank you.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 12 May 2024, 03:17
by mellinger
What is the minimum channel required, should it be 8
That depends very much on the quality of the EEG recording, and the amplitude of the subject's EEG, especially mu rhythm.
Human subjects vary widely in their EEG amplifude, and a bit in the location of the mu rhythm.
Also, the source of the mu rhythm may be located in a sulcus (brain fissure) which then requires two electrodes to take the difference at two neighboring electrodes, or it may be located at a gyrus, for which a single electrode may be sufficient.

I suggest that you read the introduction to the mu rhythm on the BCI2000 wiki: https://www.bci2000.org/mediawiki/index ... _Mu_Rhythm

A major problem with only one electrode is how to find the proper location. With multiple electrodes, you can just record a few sessions and then correlate signals with the "task". With a single electrode, you have to try blindly which is very tedious, and may lead you into nowhere.
Do you have any figure or table, etc. what is the increase in SNR or amplitude (or other variables) for this combined 8 channel vs 1 channel.
There are numerous scientific papers out there regarding this issue. I would use Google Scholar to search for "bci csp performance boost" or similar.

Re: running g.USBamp with BCI2000 using Windows 11

Posted: 12 May 2024, 03:46
by whwilbur
mellinger wrote: 12 May 2024, 03:17
What is the minimum channel required, should it be 8
That depends very much on the quality of the EEG recording, and the amplitude of the subject's EEG, especially mu rhythm.
Human subjects vary widely in their EEG amplifude, and a bit in the location of the mu rhythm.
Also, the source of the mu rhythm may be located in a sulcus (brain fissure) which then requires two electrodes to take the difference at two neighboring electrodes, or it may be located at a gyrus, for which a single electrode may be sufficient.

I suggest that you read the introduction to the mu rhythm on the BCI2000 wiki: https://www.bci2000.org/mediawiki/index ... _Mu_Rhythm

A major problem with only one electrode is how to find the proper location. With multiple electrodes, you can just record a few sessions and then correlate signals with the "task". With a single electrode, you have to try blindly which is very tedious, and may lead you into nowhere.
Do you have any figure or table, etc. what is the increase in SNR or amplitude (or other variables) for this combined 8 channel vs 1 channel.
There are numerous scientific papers out there regarding this issue. I would use Google Scholar to search for "bci csp performance boost" or similar.
Ok. Thanks.

I have now confirmed the bigger amplitude is V+ only with V- nulled because during normal use with all CommonGround and CommonReference set to False (or default of all not connected in g.USBamp). I momentary short the V- and ground of the Netech EEG simulator with a wire and the amplitude increased just like when all Ground or References set to True or all connected and all 15 channels inputed shorted which is as good as shorting the V- and ground of channel 1.

So the noises I shared since beginning is the real one. Now with noisy 10uV waveforms. The only way to analyze the signal near the noise floor is via FFT (and alike) because since white noise are flat and present at all frequency. Any weak real signal can create a peak in the noise floor.

I read Welsh plot an see peaks that normal FFT couldn't. So I'm trying EEGLab and Matlab to plot it both FFT and Welsh.

https://devcodef1.com/news/1232023/matl ... lot-alleeg

Yesterday I tried to save 2 3-minute GDF files at BCI2000 and in both, the file came with 32 bytes only. What module is the GDF file where you have fixed it already? If it is a one file exe like BCI2000Viewer or BCI2000Operator. Maybe you can share it if the next update would still be months ahead as you are waiting for other programmers to share updates or new upgrades/modules.

Many thanks for all help. Knowing now how to use both the BCI2000 and g.uSBamp with right configuration, I have to start real EEG work instead of just testing with simulator. I prefer multichannel since you just described it above it was difficult for only one electrode to find the signal. 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? Or no limit as long as you can still put (active) electrode in the head or even body scaling it even to Cerebro level (for sake of illustration) where the brain wave is scanned and amplified maybe a million times?