Reading data recorded BrainVision LiveAmp device

  • MNE version: 1.10.2
  • operating system: macOS 12.5.1

Hi,

I am trying to read data, recorded through brainvision LiveAmp, using mne.io.read_raw_brainvision function. As I understand it, MNE implicitly converts data to Volts, and in order to do so, it uses the resolution in the .vhdr file. In this case, the resolution seems 0.0407, and the unit is microvolts. So, the data gets scaled by 4.06901e-8 by MNE. However, when I use raw.get_data() * 1e6, the magnitudes I get look too big for EEG data. This is what some of the values look like: 2399.8207178, 2399.8614079, 2397.8269029, …, 2508.4225947, 2505.5335976, 2502.1563193, with min being -22459.7551871 and the max being 11820.1892193.

I am new to working with the EEG data, but these values look very different from what I see in microvolts for some of the public EEG datasets. I have also pasted the info from the .vhdr file for better understanding.

DataFormat=BINARY
; Data orientation: MULTIPLEXED=ch1,pt1, ch2,pt1 …
DataOrientation=MULTIPLEXED
NumberOfChannels=32
; Sampling interval in microseconds
SamplingInterval=1000

[Binary Infos]
BinaryFormat=IEEE_FLOAT_32

[Channel Infos]
; Each entry: Ch=,
; <Resolution in “Unit”>, Future extensions..
; Fields are delimited by commas, some fields might be omitted (empty).
; Commas in channel names are coded as “\1”.
Ch1=FC3,0.0406901,µV
Ch2=Fz,0.0406901,µV
Ch3=C5,0.0406901,µV
Ch4=F7,0.0406901,µV
Ch5=FT9,0.0406901,µV
Ch6=FC5,0.0406901,µV
Ch7=FC1,0.0406901,µV
Ch8=C3,0.0406901,µV
Ch9=T7,0.0406901,µV
Ch10=TP9,0.0406901,µV
Ch11=CP5,0.0406901,µV
Ch12=CP1,0.0406901,µV
Ch13=CPz,0.0406901,µV
Ch14=CP3,0.0406901,µV
Ch15=P7,0.0406901,µV
Ch16=C1,0.0406901,µV
Ch17=FCz,0.0406901,µV
Ch18=C2,0.0406901,µV
Ch19=CP4,0.0406901,µV
Ch20=P8,0.0406901,µV
Ch21=TP10,0.0406901,µV
Ch22=CP6,0.0406901,µV
Ch23=CP2,0.0406901,µV
Ch24=Cz,0.0406901,µV
Ch25=C4,0.0406901,µV
Ch26=T8,0.0406901,µV
Ch27=FT10,0.0406901,µV
Ch28=FC6,0.0406901,µV
Ch29=FC2,0.0406901,µV
Ch30=C6,0.0406901,µV
Ch31=F8,0.0406901,µV
Ch32=FC4,0.0406901,µV

[Comment]

BrainVision Recorder Professional - V. 1.27.0001

A m p l i f i e r S e t u p

Number of channels: 32
Sampling Rate [Hz]: 1000
Sampling Interval [µS]: 1000

Channels

Name Phys. Chn. Resolution / Unit Low Cutoff [s] High Cutoff [Hz] Notch [Hz] Gradient Offset

1 FC3 1 0.0406901 µV DC 262 Off
2 Fz 2 0.0406901 µV DC 262 Off
3 C5 3 0.0406901 µV DC 262 Off
4 F7 4 0.0406901 µV DC 262 Off
5 FT9 5 0.0406901 µV DC 262 Off
6 FC5 6 0.0406901 µV DC 262 Off
7 FC1 7 0.0406901 µV DC 262 Off
8 C3 8 0.0406901 µV DC 262 Off
9 T7 9 0.0406901 µV DC 262 Off
10 TP9 10 0.0406901 µV DC 262 Off
11 CP5 11 0.0406901 µV DC 262 Off
12 CP1 12 0.0406901 µV DC 262 Off
13 CPz 13 0.0406901 µV DC 262 Off
14 CP3 14 0.0406901 µV DC 262 Off
15 P7 15 0.0406901 µV DC 262 Off
16 C1 16 0.0406901 µV DC 262 Off
17 FCz 17 0.0406901 µV DC 262 Off
18 C2 18 0.0406901 µV DC 262 Off
19 CP4 19 0.0406901 µV DC 262 Off
20 P8 20 0.0406901 µV DC 262 Off
21 TP10 21 0.0406901 µV DC 262 Off
22 CP6 22 0.0406901 µV DC 262 Off
23 CP2 23 0.0406901 µV DC 262 Off
24 Cz 24 0.0406901 µV DC 262 Off
25 C4 25 0.0406901 µV DC 262 Off
26 T8 26 0.0406901 µV DC 262 Off
27 FT10 27 0.0406901 µV DC 262 Off
28 FC6 28 0.0406901 µV DC 262 Off
29 FC2 29 0.0406901 µV DC 262 Off
30 C6 30 0.0406901 µV DC 262 Off
31 F8 31 0.0406901 µV DC 262 Off
32 FC4 32 0.0406901 µV DC 262 Off

LiveAmp SN: 102811-1418
LiveAmp hardware revision: 5
Firmware version: 4.77

Library version: 1.24.4.8

Use Active/Dry Electrodes: Yes

S o f t w a r e F i l t e r s

Disabled

Data/Gnd/Ref Electrodes Selected Impedance Measurement Range: 25 - 60 kOhm
Impedance [kOhm] at 10:40:17 :
FC3: 9
Fz: 18
C5: 28
F7: 17
FT9: 29
FC5: 22
FC1: 23
C3: 26
T7: 25
TP9: 14
CP5: 23
CP1: 18
CPz: 9
CP3: 21
P7: 21
C1: 15
FCz: 22
C2: 22
CP4: 17
P8: 19
TP10: 11
CP6: 19
CP2: 16
Cz: 22
C4: 27
T8: 29
FT10: 36
FC6: 21
FC2: 16
C6: 28
F8: 10
FC4: 29
Gnd: 1
Ref: 23

This may be a bug in our BrainVision reader. This is really hard to help with without having access to one of the problematic files. Could you possibly share a file? Perhaps by sending us a private link if the data cannot be shared publicly?

Thank you for the reply. I have uploaded the data here.

Thanks for sharing! Unfortunately, we need more than just the .eeg file. To read it properly, we also need the .vhdr.

Ok, I see now. The data is important correctly. The high values you see are due to the DC offset. If you plot the data (raw.plot()) you can see that the data is nicely between 50-200 microvolts). You can also try this:

import numpy as np
import mne

raw = mne.io.read_raw_brainvision("my_data.vhdr")
print("Peak-to-peak difference for each channel:")
print(np.ptp(raw.get_data(), axis=1) * 1E6)

Output:

Peak-to-peak difference for each channel:
[120.035795  121.7854693 153.9713384 195.1090295 164.0217931 157.6741375
 120.1171752 123.8199743 153.5237473 153.6051275 124.918607   78.0029217
  99.8128153 135.0097518 203.4098099  94.7672429 169.677717   90.4540923
 112.304676  181.5185361 367.1467723 135.904934  141.2353371 165.2831862
 154.215479  119.9951049 377.9703389 184.4889134 157.3079266 179.850242
 342.8140925  97.3714093]

After you band-pass the data, the values should make more sense :slight_smile:

1 Like

Perfect, thank you for the help.

1 Like