Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i get Live Amp Impedance Data? #303

Open
antonello87 opened this issue Jun 14, 2018 · 9 comments
Open

How can i get Live Amp Impedance Data? #303

antonello87 opened this issue Jun 14, 2018 · 9 comments

Comments

@antonello87
Copy link

Hello,
I am trying to get the impedance data with the Live Amp amplifier. I have seen in the library (Amplifier.h) that there is a method for doing this (getImpedanceData) but till now I wasn't able to get what I want.
As I understand from the description of the library the data might be returned differently compared to the getData method (there are additional values, such as GND and REF for example) and maybe the buffer that receives and demuxes these data should be built differently.
Am I wrong? Has someone successfully tried to do the same thing? Do I have to enable channels differently? How can I tell the library what kind of electrode (active or passive) I am using?
Thanks in advance,
Antonello

@dmedine
Copy link
Contributor

dmedine commented Jun 17, 2018 via email

@antonello87
Copy link
Author

Dear dmedine,
thanks for the answer :)
I actually went through the library already and struggled to understand if I have to adapt the function pushAmpData when I set the recording mode to RM_IMPEDANCE.
For instance let's say I have 1 Live Amp 32 ch module connected to the active electrodes via 1 SplitterBox (aC-eb32) with 6 EEG Channels enabled, no bipolar channels, no auxiliary channels, accelerometers disabled and just 2 channels for triggers and 2 digital channels (always enabled), REF and GND channels on the earlobes with their clips
When I have call the method ampGetImpedanceData how will the returned packet be composed?
Based on what I read on the Amplifier_LIB I should receive a packet structured like this:
M0_GND, M0_REF, CH1,CH2,CH3,CH4,CH5,CH6
All this values are INT_32, plus 2 UINT_16 for the trigger ones and 1 UINT_32 and 1 UINT_16 for the digital ones, for a total sample size of 42.

  • Am I right? Is the packet composed like this?
  • Are the impedance values returned by the method actually INT_32 or are they FLOAT_something?
  • Do I have to take other not enabled channels into account for the sample size and then the offset?
  • Do I have to set the reference channels even if I have the REF and GND channels placed on the earlobes and i want to use them?
  • More specifically, can I access GND and REF channels to set the reference channel to the REF clips I have?
  • What are the "always enabled" Digital channels for?
    Thanks a lot and sorry for all these questions,
    Antonello

@dmedine
Copy link
Contributor

dmedine commented Jun 18, 2018 via email

@antonello87
Copy link
Author

Thanks dmedine for your prompt answer, following some comments based on what I tried today after your answer:

The impedance grabbing functionality of Amplifier_LIB.h is not implemented in LiveAmp.c/h. If you want to use it, you need to call the functions in Amplifier_LIB.h yourself.

I created a method pullImpedanceData in the LiveAmp.h and LiveAmp.cpp which grab the impedance in the same way pullAmpData does.

Are the impedance values returned by the method actually INT_32 or are they FLOAT_something?
Should be float and in Ohms according to the library comments. So your buffer that you pass to getImpedanceData will have to be of type float and the size of the number of channels you are checking, i.e. the number of enabled EEG channels.

The receive buffer cannot be a vector of float because I believe, but I may be wrong, that ampGetImpedanceData returns a flow of bytes the same way ampGetData does.

This means that I need, also in this case, to call the pushAmpData method which scans the received byte flow and demuxes it correctly based on the channel data type.
But doing as described the problem still remains, as you can see from the attached image, I keep receiving inconsistent value every column in the image refers to an electrode. In this case I run the program with REF and GND on my earlobs and just one electrode out of six (the number 1) touching the head.
This led me to think that maybe the problem is in the pushAmpData function which in this case should demuxes the data differently from when I want to acquire EEG data.

impedancecheckoutput

What are the "always enabled" Digital channels for?
Not sure what your referring to here. Is "always enabled" in the code comments somewhere? Please point me to this.

Code from LiveAmp.cpp, almost the end of enableChannels function

if(cnt!=enabledChannelCnt+2)
// add two because we are ignoring (for now) the CT_DIG channels, which are enabled

P.s. I will be very grateful if you can check when you will be back at your desk :)

@dmedine
Copy link
Contributor

dmedine commented Jun 19, 2018 via email

@antonello87
Copy link
Author

I don't clearly understand what you are trying to do, design wise. Do
you want to transmit impedance data via LSL? Do you need to check
impedances intermittently during a recording?

Basically I would like to check the impedance just once, before starting the
recording. Of course once I will be able to receive consistent impedance values
the best way to do things will be to create a separate outlet that sends them.

I will play around with this in the coming weeks and come up with a
simple working example. Ping me if you don't hear from me after a while.

Thank you very much for that :)

@antonello87
Copy link
Author

Dear dmedine,

I will play around with this in the coming weeks and come up with a
simple working example. Ping me if you don't hear from me after a while.

As promised I ping you :)
Did you manage to come up with some working examples?

Thanks a lot.

@antonello87
Copy link
Author

Dear dmedine,
I'm sorry to bother you again but I have to try to get these impedance data as soon as possible.
Did you manage to come up with some working examples?

Thanks in advance and please forgive my stubborness.

@dmedine
Copy link
Contributor

dmedine commented Aug 27, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants