Biosignal Tools Wiki
Brought to you by:
schloegl
BioSig is a software library for processing of biomedical signals (EEG, ECG, etc.) with Matlab, Octave, C/C++ and Python. A standalone signal viewer supporting more than 30 different data formats is also provided.
Wiki: FAQ
Wiki: Installation
Wiki: Usage
I am trying to install Biosig for python3 but I have the following error:
I have Linux Mint 19 Tara and Python 3.7.5
I installed it with:
and also compiling the source code:
both the same error:
I try debug:
I install the recommended packages:
--- Recommended packages at runtime ---
sudo apt-get install libb64 tinyxml python-numpy python3-numpy R openjdk-11-jre octave octave-tsa octave-nan
E: Unable to locate package libb64 #but install libb64-dev
E: Unable to locate package tinyxml #but install libtinyxml-dev
E: Unable to locate package R #not installed
I also installed libbiosig-dev
something strange is that biosig works in python2
To install biosig - including python3 binding - from source, you need to use the compile time prerequisites, If you are interested only in the python bindings (not Octave, Java, R, python2), these should be sufficient.
After downloading and decompression of
http://sourceforge.net/projects/biosig/files/BioSig%20for%20C_C%2B%2B/src/biosig-2.0.6.src.tar.gz
you need to run:
That should do it. ( I did not test this on Mint, but on Debian).
Last edit: Alois Schloegl 2020-10-06
Hello, Alois!We are currently engaged in the process of designing a neurofeedback training protocol. We would like to process the 5 channels of the central area online, and we think that it would be better to use linear regression to remove eye movement artefacts. We found your article published in 2007 demonstrated in detail the computational process and advantages of this method (Schlögl et al., 2007)
and its use in biosig (Vidaurre et al., 2011).
Our questions now are:
1, we added the biosig plugin in EEGLAB→Manage EEGLAB extensions, but it does not appear in the GUI page, are we right? How can we use the online processing method rstBCI you mentioned in biosig.
2, We have only 1 EOG channel, as well as several related application articles (Scherer et al., 2008; Supp et al., 2007) that use three channels. Is it possible for us to use this linear regression for EOG correction?
Looking forward to your reply!
Last edit: Freya 2024-11-05
Hello Freya,
Concering 1):
I'm not using EEGLAB so I can not comment on this.
do you mean "rtsBCI" [2] (no rstBCI) which is the Matlab/Simulink-based recording from Reinhard Scherer.? It that case, you might need to add simulink block that multiplies the sampling vector with a suitable, sparse, re-referencing matrix.
Concering 2). Technically, you can. The question is about the resulting signal quality.
(i), you will capture and reduce only 1 spatial EOG components.
(ii), which reference electrode are you using for EOG. Is it a bipolar EOG channel (e.g. 2 electrodes near the eyes, and the potential differences between these are recorded in the EOG channel.)
or do you use the common ground electrode (e.g. the mastoid, behind an ear). In the later case, you will most likely also remove some common EEG activity. I stŕongly reommend to use only bipolar EOG channels (can be computed online as well).
I recommend to check visually (Fig 3 [1]) and quantitatively (Fig4, [1]. )
[1] A. Schlögl, C. Keinrath, D. Zimmermann, R. Scherer, R. Leeb, G. Pfurtscheller.
A fully automated correction method of EOG artifacts in EEG recordings.
Clin.Neurophys. 2007 Jan;118(1):98-104. Epub 2006 Nov 7 Paper(pdf)
[2] https://sourceforge.net/projects/biosig/files/rtsBCI/
Last edit: Alois Schloegl 2024-11-06
Thanks so much for your suggestion – it's really helpful! We're currently using the Brain Products system to collect EEG data, and gathering EOG data through a ground electrode (AFz) and a subocular channel.
Our main goal is to analyze aperiodic neural activity through real-time signal processing. However, as you anticipated, in the process of removing the ocular artifacts, we also ended up removing some of the aperiodic neural activity (the 1/f fit gave us negative values, which is unusual). We tried adjusting the coefficient (for example, 0.5 * b), but that doesn’t seem like a very convincing solution. Do we have to check visually (Fig 3 [1]) and quantitatively (Fig 4, [1]) as you mentioned by about 20 people offline before we can proceed with the online study?
Since you’re clearly an expert in signal processing, I was wondering if you have any additional suggestions for real-time ocular artifact removal?Perhaps ways to optimize our current method, or a more mature approach for removing eye movement artifacts in real time?
Last edit: Freya 2024-11-17
For most pratical purposes, the method described in [1] as good as you can get. Make sure that the EOG channel are close to the eyes so that it does not pick up to much EEG activity. If you want to improve on that, you might try some subspace methods (ICA, PCA, etc.) but you need a large number of electrodes (at least 20, probably more) in order to identify a 3rd spatial EOG component.
Concering the 1/f analysis, you should take into account that this might be conflated by other artifact sources, like amplifier noise, quantization noise, and impedance noise. These will increase when applying regression analysis or any other component-based (ICA, PCA, subspace) method. You might want to check until which frequency the EEG activity is larger than these noise sources. Often, high frequency components of EEG might be smaller than these artifacts, and you should omit those in your 1/f analysis. Some more details are available here [3].
[3] https://pub.ista.ac.at/~schloegl/qc/
Last edit: Alois Schloegl 2024-11-17
Thanks again for your reply! Our neurofeedback training protocol only collected EEG signals from the central zone (Fz/FC1/FC2/FCz/Cz). For this aspect, regression analysis may be more suitable for us.
As you said, any method has the potential to increase noise when removing EOG artefacts. If we still use the regression approach, we report (Fig 3 [1]) and (Fig 4, [1]. ) via a pre-experiment , is this convincing enough? I meant to report only how many EOG artifacts were removed from the EEG data, not for more accurate EOG removal
Last edit: Freya 2024-11-17
Dear Freya,
I believe I provided a fair and balanced assessment what the method can and can not provide. Whether this is "convincing", or in other words good enough for your purpose, is not up to me to decide.
Thanks for your reply! it has really cleared things up for me!!!