Re: Using modularEEG to acquire ERG data

Ian Campbell <[email protected]> Mon, 31 Aug 2015 14:34:10 -0400
Newsgroups gmane.comp.science.openeeg.general
Message-ID <[email protected]>
Hi Stefan,

Thanks for the info, and my apologies for the delayed response. My 
responses are inline below:

On 8/27/2015 2:30 AM, Stefan Jung wrote:
> Hi Ian
> I know of EOG but have not come across ERG.
It's a pretty interesting technique used in ophthalmology to diagnose 
and track ocular disorders. The various cells of the retina have 
well-documented electrical responses to specific visual stimuli, so you 
can learn a lot about visual pathology using ERG.

> So you have a professional amplifier with limited software capability?
Yes, we have a turnkey ERG system including an amplifier from a 
commercial vendor (name withheld to protect the guilty). Unfortunately, 
the software they provide is awful (lots of bugs including changing user 
parameters without notice, inability to save individual waveforms, no 
ability to introduce a new visual stimulus, etc.). Additionally, it only 
has drivers for Windows XP 32-bit edition, and the vendor of the USB 
chip obsoleted the chip a decade ago and does not provide new drivers.

Interestingly, the system actually DOES ship with DLL files to access 
the amplifier for custom coding, and the company's website even 
advertises this as a selling point. Unfortunately, none of the functions 
documented in the manual match the functions that exist in the DLL, so I 
have no idea what arguments they take or what order they need to be 
called in to initialize the hardware safely. To add icing on the cake, 
the DLL "for developers" is different than the one their software uses. 
The company has told me that the individuals who wrote the code don't 
work there any more, so nobody knows how to help me.

I've played around with decompilers and debuggers for weeks trying to 
figure out what is going on with their stupid DLL, and I finally had to 
give up. I would be better off starting from scratch than continuing to 
work with their unsupported hardware, I've decided, and hence my 
interest in finding a new amplifier/ADC system.

Right now, I'm trying to figure out how extensible the various ExG 
amplifiers are for my needs, as I am not an electrical engineer and only 
know rudimentary concepts of amplifier design. I'm not quite sure how 
different the signal acquisition side of things is for the various forms 
of electro X-ology, other than the amplification gain and the passbands 
(obviously, the physiology is different, but I'm not sure how that does 
or doesn't impact the signal acquisition side).

> I know that the EOG has DC components and one therefore would like a 
> DC amplifier for EOG applications.  EOG also has a higher bandwidth 
> requirement than EEG.  How does ERG compare?  Basically one needs to 
> know this:
> 1. What is your bandwidth requirement (do you need to work from 0Hz 
> i.e. DC?)
With our commercial system, we typically set the passband from 0.3 Hz to 
500 Hz, so I don't think we need DC amplification.

> 2. How many channels do you need?
2 channels (differential, plus ground) are the minimum, but we'd 
actually like to have 6+ channels in an ideal world so that we can try 
out some new techniques. That's part of the reason I'd like to work with 
open hardware, so that we can extend things like the number of channels.

> 3. Do you need concurrent sampling with zero sampling skew ( a lot of 
> EMG work has this requirement)
Ideally, yes, we need to be able to acquire both channels 
simultaneously. If that's a deal-breaker then we could study both eyes 
one at a time, but being able to synchronize our visual stimulus with 
the recorded channels with at least 1ms accuracy would be optimal.

> You could modify the openEEG amp quite easily for slightly lower 
> gain.  You could also increase the sampling rate and the bandwidth if 
> you only need/use 2 channels.  OpenEEG as well as many other cheap 
> amplifiers use multiplexed ADCs which produce lots of sampling skew... 
> so concurrent sampling is not possible on those.
I see, thanks for the heads up on this. A multiplexed ADC probably 
wouldn't work for our needs, then. Would it be possible to, say, use 6 
single-plexed boards with their own ADC chip (other than being 
cumbersome/expensive)? Or is that going to introduce other sorts of 
noise problem?

> If you had a 16-bit EEG amp that would be good.  OpenEEG's 10-bit 
> resolution is a bit low, so you would need to adjust the latter's 
> gain, so as to obtain optimum dynamic range for your application.  But 
> that should is easy.
Yes, 10 bits is probably the lowest we could tolerate for our needs. 
We'd probably need to tweak the gain, but that's relatively 
straightforward, as I understand. How feasible would it be to take the 
existing amplification circuit and drop in a higher-bitrate ADC chip? If 
I can just get the analog signal digitized and into a PC, then I'm home 
free, but I don't know that I am capable of designing an amplifier all 
by myself that won't have its own set of ground loop or ringing or other 
undesirable features.

> Rather than to dump your current amplifier, I would suggest trying to 
> use it with different software.  There are 4 possibilities I could 
> think off.
This would definitely be my ideal solution, and thanks for the 
suggestions below, but I think I've tried most of the low-hanging fruit 
on interfacing with it and should probably move on.

> 1. Larry Janow is hopeless with BioExplorer support, so asking him to 
> develop a driver for your amplifier is useless. Instead, you or 
> someone else could write a protocol translator, a program that runs on 
> your PC to intercept your current amplifier's protocol, translates and 
> parses it, into a different protocol that BE understands.  Many years 
> ago I wrote such a bridge program to allow data from the Wild Divine 
> "Stone" (SCL and HRV data) to be read by BioExplorer.   It is messy 
> and far from ideal.  I would not really recommend this route, but I do 
> mention this as a possibility.
> 2. You could supply the protocol definition to Jarek 
> Foltynski who would most likely agree to write a driver for BioEra.  
> BioEra is more powerful than BioExplorer, but much more difficult to 
> use.   You would also have to buy BioEra for about $300USD.  Jarek 
> would prefer to get an amplifier for testing purposes, but I don't 
> think that is a strict necessity.
> 3. You could develop your own driver (or ask someone else to do so) 
> for openVibe (open source).
> 4. You could perhaps use Chris Veigl's BrainBay which is also open 
> source.  Again you would need to develop a driver, or get someone else 
> to help with that.  I don't really know BrainBay, not sure if it had 
> sufficient capability for your application.
> You can normally place a snooper onto RS232 lines or, if your 
> amplifier is USB interfaced, run a software snooper, capture some raw 
> data and reverse engineer the protocol.  I reverse engineered the QDS 
> 8-channel protocol (which is supported by BE) without ever laying a 
> hand (or eye) on QDS hardware.  A friend simply connected his QDS to 
> BioExplorer and send me a PrintScreen of the comms debug window within 
> BioExplorer.  From that raw data it was very quick and easy to figure 
> out what was going on.  It really only took me a couple of minutes.  
> But I was lucky.  It could be more difficult, depending on the 
> complexity of the protocol, what sort of hardware layer is used, etc., 
> etc.  I implemented the QDS protocol on my own EEG amplifiers, so in 
> effect I did the inverse of what you should try and do.
Interesting, I haven't tried a software snooper (it's a USB connection). 
The idea had occurred to me, but I didn't realize that was a thing that 
existed and figured I would need some sort of hardware snooper, which I 
don't have. I do think reverse engineering the protocol should be pretty 
trivial--there aren't THAT many options presented to the user.

> The other option would be to rewrite your current bio-amplifier's 
> embedded firmware.  That's what I would do - LOL.  It depends how good 
> your amp is, how expensive, what sort of micro it uses, etc., etc.  
> Basically you would "teach" your amplifier a new language, for 
> instance that QDS-protocol.  Then you could connect it to BE, Bioera 
> and I would hope, to openVibe.  I am pretty sure that Chris Veigl also 
> has QDS support for BrainBay, due to my publishing and implementing it 
> on some of my hardware.
Haha, I like your idea. Unfortunately, I share this hardware with some 
other folks who use the turnkey features of the system, so I can't take 
away any current compatibility (no matter how much I want to!).

> Good luck.
> Regards
> Stefan
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Openeeg-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/openeeg-list
> Go to the above address to change your
> subscription options, e.g unsubscribe.

------------------------------------------------------------------------------