Effect of gain on data amplitude

Hi,
I am new to working with Cyton Board. With this I capture the facial gesture data such as Eyebrow rise, Eyeblink, Mouth open close etc.
I observed that there is difference in amplitude of gesture data when I set least gain (x1) and when I set highest gain (x24) in OpenBCI. I referred to previous discussions in this Forum and there was mention of input signal exceeding common mode voltage range with increase in gain. But my signal amplitude is in microvolts (uV), which is well within the CM range. Then why am I observing the difference? Is this normal?

I referred to the datasheet of ADS1299. There was no mention of such difference in amplitudes with change in gain. Is there any factor I am missing? Please help.

Thank you.

Comments

  • wjcroftwjcroft Mount Shasta, CA
    edited August 2023

    Hi Veda,

    As you can see from this page, the gain is part of the formula for converting sample raw value into volts or microvolts,

    https://docs.openbci.com/Cyton/CytonDataFormat/#interpreting-the-eeg-data

    For the scale factor, this is the multiplier that you use to convert the EEG values from “counts” (the int32 number that you parse from the binary stream) into scientific units like “volts”. By default, our Arduino sketch running on the OpenBCI board sets the ADS1299 chip to its maximum gain (24x), which results in a scale factor of 0.02235 microVolts per count. Because the gain is user-configurable (24x, 12x, 8x, 6x, 4x, 2x, 1x), the scale factor will be different. If the gain is changed, the equation that you should use for determining the scale factor is:

    Scale Factor (Volts/count) = 4.5 Volts / gain / (2^23 - 1);

    Not sure I'm following your common mode points. The conversion formula shown on the page above is also viewable in the TI data sheet.

    Regards, William

  • wjcroftwjcroft Mount Shasta, CA

    It's possible that if you are using Brainflow, I'm not sure there is any way in the Brainflow API to communicate changes in gain to the lower level code that does the conversion to microvolts. Hence changing the hardware gain setting has the effect of scaling the actual output values.

  • Thank you wjcroft.
    I want to know whether the gain applied by setting value in OpenBCI will it be applied to the actual data being logged?
    I have given input from Function generator (2mVp-p, 20Hz). I connected Function generator positive to IN1N, Function generator negative to IN1P and shorted BIAS to Function generator positive. Below are my results,

    Why is the amplitude at similar range even when I change gains?

  • VedashreeVedashree India
    edited August 2023

    Thank you wjcroft.
    I want to know whether the gain applied by setting value in OpenBCI will it be applied to the actual data being logged?
    I have given input from Function generator (2mVp-p, 20Hz). I connected Function generator positive to IN1N, Function generator negative to IN1P and shorted BIAS to Function generator positive. Below are my results,

    Why is the amplitude at similar range even when I change gains?

  • wjcroftwjcroft Mount Shasta, CA

    OK, I am not understanding your readings.

    I highly suggest you email to (contact at openbci.com) which is customer support. And supply a link to this thread on the Forum,

    https://openbci.com/forum/index.php?p=/discussion/3660/effect-of-gain-on-data-amplitude

    Are you seeing these same behaviors with the OpenBCI GUI? What program is producing the screenshots you provide? A major point I do NOT understand is why your signal generator output is 2 millivolts, yet all your measurements show only about 40 microvolts. This seems HIGHLY suspect. And does not seem possible to me. Because if that was the case all Cyton users who are doing ECG would be getting totally wrong recordings. And that has not been reported.

    Can you also confirm your date of purchase of the Cyton and where purchased? There are a number of badly produced Chinese 'clone' boards on the market (sold at Chinese online sites) that produce erroneous results.

    Thanks, William

  • VedashreeVedashree India
    edited August 2023

    Thank you wjcroft. I will email openbci customer support.

    Are you seeing these same behaviors with the OpenBCI GUI?
    I am using OpenBCI GUI.

    What program is producing the screenshots you provide?
    As the logged data from OpenBCI is in .BDF format, I am visualizing in EDF Browser. I have noted the values in a document and attached the snip above.
    A major point I do NOT understand is why your signal generator output is 2 millivolts, yet all your measurements show only about 40 microvolts.
    I will tell you a bit about my setup. Please point if I have not setup properly.
    I have given input from Function generator (2mVp-p, 20Hz). I connected Function generator positive to IN1N, Function generator negative to IN1P and shorted BIAS to Function generator positive. In OpenBCI GUI, I disabled SRB2 all other channels. I have not applied Notch filter in GUI. I then logged data by setting different gains in OpenBCI GUI and sending the hardware changes.

    Can you also confirm your date of purchase of the Cyton and where purchased?
    8 channel Cyton Biosensing Board was purchased on June 30, 2020 from OpenBCI shop website.

    Please tell if I am missing anything.
    Thank you.

  • wjcroftwjcroft Mount Shasta, CA

    Please email customer support as I suggested. I have no idea why you are seeing discrepancy between your 2mV signal and what you are getting. SOMETHING is wrong.

  • wjcroftwjcroft Mount Shasta, CA

    @Vedashree said:
    ...
    Are you seeing these same behaviors with the OpenBCI GUI?
    I am using OpenBCI GUI.

    You did not answer my question. Are you seeing the Time Series graph in OpenBCI GUI, showing ~42 microvolts when you input 2mV? What happens when you drop the input to 1mV? Etc. Are you sure the voltage scale in the Time Series is set correctly?

    IF you are seeing the same strange behavior in your tests using OpenBCI GUI DIRECTLY (not with EDFBrowser), then I would highly suspect your signal generator output or connections are not providing the 2mV as expected. Do further testing of your generator with a reputable oscilloscope.

  • Below I am sharing the video link for plot window for 2mVp-p, 20Hz with gain = 1 setting in OpenBCI GUI.
    https://drive.google.com/file/d/1F7kr2Rjwp_hG3aTlKpDKGmR7xnRVnFCG/view?usp=drive_link

    Below is the file that is logged from above session.
    https://drive.google.com/file/d/1XDGEMZKTfAhZB_cyiZQb2yJq-n184isi/view?usp=drive_link

    What happens when you drop the input to 1mV?
    The Function generator I use has 2mVp-p as the least setting for input amplitude.

    Do further testing of your generator with a reputable oscilloscope.
    Sure. I will check the Function generator output with an oscilloscope and get back to you.This would take some time as I do not have one with me.
    In the meantime please share any details helpful that I am missing.

  • wjcroftwjcroft Mount Shasta, CA

    @Vedashree said:
    Below I am sharing the video link for plot window for 2mVp-p, 20Hz with gain = 1 setting in OpenBCI GUI.
    https://drive.google.com/file/d/1F7kr2Rjwp_hG3aTlKpDKGmR7xnRVnFCG/view?usp=drive_link

    This video invalidates the earlier results you claimed, saying that the Cyton reported ~40 uV output from the 2 mV input. The video clearly shows millivolt level output. I would highly suspect whatever manipulations are happening before your screenshots above showing 40 uV output.

    What happens when you drop the input to 1mV?
    The Function generator I use has 2mVp-p as the least setting for input amplitude.

    My point was to ask you to simply change the output level around somewhat and see if the GUI Time Series reflects that.

  • I would highly suspect whatever manipulations are happening before your screenshots above showing 40 uV output.
    Please check the .BDF file attached from the same session logged in OpenBCI GUI.
    I am using EDF Browser to visualize the data and I am not seeing 2mVp-p as in Plot window of GUI.

  • wjcroftwjcroft Mount Shasta, CA

    You may be operating / using EDFBrowser in such a way that it is misinterpreting the recording file. I suggest looking at the CSV file. It contains microvolt level channel columns.

  • Below is the .csv file I extracted from EDF Browser (Tools -> Export EDF/BDF to ASCII (CSV))
    https://docs.google.com/spreadsheets/d/1tLEZozoaDGbHm-IWZlqKc-f4QfQHV71t/edit?usp=drive_link&ouid=112024296106530295103&rtpof=true&sd=true

    If the problem is viewing in EDF Browser itself, please suggest alternate for visualizing the logged data from OpenBCI.
    Thank you.

  • wjcroftwjcroft Mount Shasta, CA

    NO, I am telling you to OUTPUT CSV directly from the GUI.

  • wjcroftwjcroft Mount Shasta, CA

    EDFBrowser can input CSV files, if you look at their manual pages.

  • @wjcroft said:
    NO, I am telling you to OUTPUT CSV directly from the GUI.

    I have selected such option in GUI and output file was saved in .txt file, which I then converted to .csv (changing extension)
    I have attached the file.
    https://drive.google.com/file/d/1k7hOtSwAbSbyyhTa0tSuN8R2VCg7s83o/view?usp=drive_link

    @wjcroft said:
    EDFBrowser can input CSV files, if you look at their manual pages.

    The .csv file is then converted to EDF file. I could see approximately 2mVp-p signal now.

    Thank you for your suggestion wjcroft.

  • I still didn't get why the .EDF file logged directly from the GUI showed different results from the amplitude shown in plot window of GUI in previous session.

Sign In or Register to comment.