Notebooks

Learn signal processing techniques

Biosignals are amazing sources of information, but, knowledge is not achievable in an immediate way, so signal processing methodologies are essential in Biomedical research and in the implementation of artificial systems used in clinical environments. Python is a very intuitive programming language that will help you extract knowledge from biosignals, considering its vast community that creates and shares innovative algorithms, which you can simply use or improve.

😏 Are you ready to start an amazing journey through biosignals processing using Python?
Certainly you are, so, be welcome to a new learning environment created by PLUX and entitled biosignalsnotebooks!!!

biosignalsnotebooks (see project presentation and video) includes a set of tutorials, that provide programming examples in the form of Jupyter Notebooks and a Python library, being the perfect guide and companion through your journey in the biosignals world. This collection of code samples has the purpose to help our community of BITalino and biosignalsplux users or researchers and students interested on recording, processing and classifying biosignals. The examples are set on a level of complexity to inspire the users and programmers on how easy some tasks are and that more complex ones can also be achieved, by reusing and recreating some of the examples presented here.

Be inspired on how to make the most of your biosignals!



Getting Started

First steps to get you set and ready that include a free copy of our amazing OpenSignals software.

Download, Install and Execute Anaconda

Operations that should be completed in order to have Jupyter Notebook ready to use and to open our ipynb files on local server.

Open Notebook

Download, Install and Execute Jupyter Notebook Environment

Operations that should be completed in order to have Jupyter Notebook ready to use and to open our _rev.html files on local server.

Open Notebook

Quick-Start Guide

Do you have everything set up?
After installing Jupyter Notebook environment you are now ready to create your first tutorial with the guidance of this learning resource.

Open Notebook

Pairing a Device at Windows 10 [biosignalsplux]

How PLUX's acquisition systems ( biosignalsplux in our example) can be quickly connected to a computer in order to ensure future real-time acquisitions through OpenSignals.

Open Notebook



Data Acquisition

Learn how to record, load and on how to prepare graphical visualizations of your data.

Problems of low sampling rate (aliasing)

In the following steps it will be demonstrated how the sampling rate choice affect signal morphology.

Open Notebook

Resolution - The difference between smooth and abrupt variations

The importance of choosing a proper sampling frequency, resolution is another parameter that must be configured prior to acquisition.

Open Notebook

EEG - Electrode Placement

Electrical impulses generated at a neuronal level can be recorded through Electroencephalography (EEG). Learn how to properly place EEG electrodes to obtain a high quality signal.

Open Notebook

Signal Acquisition [OpenSignals]

Introductory journey through OpenSignals, explaining/demonstrating how signals can be acquired in real-time.

Open Notebook

Store Files after Acquisition [OpenSignals]

In the current Jupyter Notebook it will be demonstrated how the user can store in a file the previously acquired signals.

Open Notebook

Load Signals after Acquisition [OpenSignals]

In the current Jupyter Notebook we continue the interaction with OpenSignals , demonstrating how the previously acquired/stored files can be loaded.

Open Notebook

Load acquired data from .h5 file

It will be explained how to load/transpose the data inside .h5 file to a Python list, that can easily be manipulated in the processing operations.

Open Notebook

Load acquired data from .txt file

In this Jupyter Notebook it will be explained how to load/transpose the data inside .txt file to a Python list, which consists in a step that precedes all processing operations.

Open Notebook

Signal Loading - Working with File Header

In the current Jupyter Notebook a detailed procedure for accessing file metadata (.txt and .h5) is explained, together with a simplified approach through the use of a biosignalsnotebooks specialized function.

Open Notebook

EEG - Loading Data from PhysioNet

As an explorer you should know that, in addition to the data that you collect, other sources of informations are available in the world wide web. PhysioNet is a research database dedicated to store a diversified set of biosignals. Learn how to access data from there!

Open Notebook

Plotting of Acquired Data using Bokeh

Information is converted into knowledge through data analysis. The kernel behind an effective conversion lies in the graphical representation of previously acquired data. This Jupyter Notebook shows how this challenge can be overtaken!

Open Notebook

Introduction to Android sensors

An overview of all sensors supported by the Android operating system as well as a look into the limitations and peculiarities of the system. All basics that you need to know before starting to acquire data from android sensors using the OpenSignals mobile application are gathered here!

Open Notebook



Signal Processing

Learn how to record, load and on how to prepare graphical visualizations of your data.

ACC Sensor - Unit Conversion

In spite of the unit conversion procedure has some common steps applicable to all sensors, the current Jupyter Notebook is dedicated to the unit conversion procedure of signals acquired with Accelerometer (ACC) sensor.

Open Notebook

BVP Sensor - Unit Conversion

The current Jupyter Notebook is dedicated to the unit conversion procedure of signals acquired with Blood Volume Pulse (BVP) sensor.

Open Notebook

ECG Sensor - Unit Conversion

The current Jupyter Notebook is dedicated to the unit conversion procedure of signals acquired with Electrocardiographic (ECG) sensor.

Open Notebook

EDA Sensor - Unit Conversion

The current Jupyter Notebook is dedicated to the unit conversion procedure of signals acquired with Electrodermal Activity (EDA) sensor.

Open Notebook

EEG Sensor - Unit Conversion

The current Jupyter Notebook is dedicated to the unit conversion procedure of signals acquired with Electroencephalographic (EEG) sensor.

Open Notebook

EMG Sensor - Unit Conversion

The current Jupyter Notebook is dedicated to the unit conversion procedure of signals acquired with Electromyographic (EMG) sensor.

Open Notebook

fNIRS Sensor - Unit Conversion

The current Jupyter Notebook is dedicated to the unit conversion procedure of signals acquired with Functional Near-Infrared Spectroscopy (fNIRS) sensor.

Open Notebook

Goniometer Sensor - Unit Conversion

The current Jupyter Notebook is dedicated to the unit conversion procedure of signals acquired with Goniometer (GON) sensor.

Open Notebook

PZT Sensor - Unit Conversion

The current Jupyter Notebook is dedicated to the unit conversion procedure of signals acquired with Piezoelectric Respiration (PZT) sensor.

Open Notebook

RIP Sensor - Unit Conversion

The current Jupyter Notebook is dedicated to the unit conversion procedure of signals acquired with Respiratory Inductive Plethysmography (RIP) sensor.

Open Notebook

SpO2 Sensor - Unit Conversion

The current Jupyter Notebook is dedicated to the unit conversion procedure of signals acquired with Oxygen Saturation (SpO2) measurement sensor.

Open Notebook

Generation of a time axis

Time is an extremely important dimension, not only in our daily routine but also in data analysis. This Jupyter Notebook is dedicated to the task of generating a relative time-axis considering an important parameter used by the Analog to Digital Conversion (ADC) module: Sampling Rate

Open Notebook

Resampling of signals recorded with Android sensors

The android system does not ensure an equidistant sampling of the data acquired from its sensors. In this Jupyter Notebook it is demonstrated how to re-sample RAW android data to ensure equidistance of the sampling points.

Open Notebook

Signal to Noise Ratio Determination

PLUX sensors ensure the acquisition of high-quality data, minimizing the influence of noise. Despite the powerful filtering capabilities of PLUX systems, residual noise levels still persist. This Jupyter Notebook shows how to evaluate the signal quality through a Signal to Noise Ratio estimate.

Open Notebook

Computing SNR for ECG Signals

This Jupyter Notebook explores the most recommendable Signal to Noise Ratio (SNR) methodology to be applied in periodical time-series such as the Electrocardiographic (ECG) signal.

Open Notebook

Computing SNR for Slow Signals

In line with the previous two Jupyter Notebooks, the Signal to Noise Ratio (SNR) estimate is the main focus of this tutorial. The presented methodology is intended to be applied into slow (low-frequency) signals.

Open Notebook

Digital Filtering - A Fundamental Pre-Processing Step

In this Jupyter Notebook it will be demonstrated how to digital filter the signal.

Open Notebook

Digital Filtering - Using filtfilt

Conventional digital filters are quite useful while processing a signal, however, they can create a dephased output. In certain applications this phenomenon should be avoided, something achievable through zero-phase filters (using filtfilt methodology). Are you ready to explore them?

Open Notebook

Digital Filtering - EEG

Electroencephalographic (EEG) data is typically very noisy, considering not only the interference between neural sources but also with external electromagnetic phenomena. This Jupyter Notebook presents some approaches that can be followed to minimized the impact of multiple types of noise in EEG.

Open Notebook

Device Synchronisation - Cable, Light and Sound Approaches

Multi-channel capabilities of PLUX devices provide freedom to the researcher, however, science has no limits. Trials can be conducted using multiple devices, being this Jupyter Notebook dedicated to show how to synchronise all signals acquired in a multi-device session.

Open Notebook

Synchrony - Accelerometer Signal

As a natural spin-off of the "Device Synchronisation - Cable, Light and Sound Approaches" tutorial, this Jupyter Notebook shows how to synchronise multiple channels of data using the signal generated by an Accelerometer as a reference.

Open Notebook

Synchrony - Light Signal

As a natural spin-off of the "Device Synchronisation - Cable, Light and Sound Approaches" tutorial, this Jupyter Notebook shows how to synchronise multiple channels of data using the signal generated by a Light source as a reference.

Open Notebook

Synchrony - Acoustic Signal

As a natural spin-off of the "Device Synchronisation - Cable, Light and Sound Approaches" tutorial, this Jupyter Notebook shows how to synchronise multiple channels of data using an acoustic signal as a reference.

Open Notebook

Synchronising data from multiple Android sensor files into one file

When acquiring data from multiple Android sensors at the same time, the data from each sensor is saved into a separate file. This Jupyter Notebook shows how to synchronise all of these individual data streams and save them into a single file.

Open Notebook

Synchronising Android and PLUX sensors

Acquiring data from Android and PLUX sensors using the OpenSignals mobile application requires a subsequent synchronisation process. How this is achieved is presented in this Jupyter Notebook.

Open Notebook

Activity Distinction using Android Sensors

Prior to a deeper data analysis, observation is essential to reach a proper interpretation of some events. This Jupyter Notebook shows how to distinguish 4 different physical activities (through a visual inspection), using data obtained from a diversified set of Android sensors.

Open Notebook

Event Detection - Muscular Activations

Detecting events is an important task in signal processing challenges, considering that an algorithm is able to effectively and automatically identify events in a fraction of seconds. This Jupyter Notebook is dedicated to a specific type of events: Muscular Activations!

Open Notebook

Event Detection - R Peaks (ECG)

As highlighted on "Event Detection - Muscular Activations" tutorial, detecting events is not only useful but also essential in signal processing. In order to continue exploring this thematic, open the current Jupyter Notebook to learn how to detect each QRS complex from an Electrocardiogram (ECG).

Open Notebook

EEG - Event Related Potentials (ERP) Detection

This Jupyter Notebook is dedicated to explore the impact of specific acoustic events at a neuronal level. An Odd acoustic event is responsible for the generation of the so called Event Related Potentials (ERP), whose study can provide important clues regarding changes in auditory sensory memory and decision making processes.

Open Notebook

Detection of Outliers

While acquiring biosignals short-time abnormal events can be captured by the sensor. These "acute" events are typically categorized as outliers, i.e., a point or a segment in our data that is not related with the physiological phenomenon under analysis.
Learn how to automatically identify these events!

Open Notebook

Generation of Tachogram from ECG

Prior to start a Heart Rate Variability (HRV) analysis it is necessary to estimate the duration of each cardiac cycle. Using the concepts of "Event Detection - R Peaks (ECG)" tutorial, this Jupyter Notebook is dedicated to present the RR interval time-series: Tachogram

Open Notebook

Generation of Poincaré Plot from ECG Analysis

Poincaré Plot is a graphical resource used to conducted a non-linear Heart Rate Variability (HRV) analysis. In the Poincaré "environment" a pair of consecutive RR intervals is represented by a point in a bidimensional coordinate system.
Are you curious about this topic?

Open Notebook

Parameter Extraction - Temporal and Statistical Parameters

All the previous tutorials were dedicated to prepare your data to be analysed. This Jupyter Notebook presents a methodology that must be followed to extract conventional temporal and statistical parameters from the acquired and pre-processed signals.

Open Notebook

EMG Analysis - Time and Frequency Parameters

Following the same principles presented on "Parameter Extraction - Temporal and Statistical Parameters", this Jupyter Notebook is dedicated to explore time/statistical analysis applied to an Electromyographic (EMG) signal.

Open Notebook

Fatigue Evaluation - Evolution of Median Power Frequency

In this Jupyter Notebook it will be presented the basic methodology to monitoring the fatigue along time.

Open Notebook

ECG Analysis - Heart Rate Variability Parameters

Taking into consideration the periodicity of Electrocardiographic (ECG) data, understanding how this periodicity changes could provide important information to identify or evaluate certain diseases. In this Jupyter Notebook you will be able to conduct a Heart Rate Variability (HRV) analysis.

Open Notebook

EEG - Alpha Band Extraction

Electroencephalographic (EEG) data can be decomposed into multiple frequency bands, each one transmitting very specific informations regarding unconscious processes, emotional states or premeditate actions. Through this Jupyter Notebook you will be able to explore the Alpha Band!

Open Notebook

Force Platform - Center of Pressure Estimation

Despite natural, walking on two feet is a very challenging task. Human body is constantly searching for a biomechanical equilibrium state, i.e., the center of pressure of our body is continuously being readjusted. This Jupyter Notebook shows how to achieve a center of pressure estimate.

Open Notebook

Calculate Time of Flight

When a basketball player jumps to score a fantastic point the crowd has the opportunity to watch something epic: a flight for glory. "How many seconds did that player stayed in the air?" is the question echoing in the stadium. With this Jupyter Notebook you will be able to answer it!

Open Notebook

GON - Angular velocity estimation

Measuring angular displacements is a task that can be achieved easily and with high precision through Goniometers (GON). In this Jupyter Notebook it will be possible to explore one specific parameter extractable from GON data: Angular Velocity

Open Notebook

EMG - Overview

Navigating through the previous Jupyter Notebooks, provided relevant concepts and methodologies related with the biosignals recording and processing stages. This tutorial joins both stages into a summarized format for the specific case of Electromyography (EMG).

Open Notebook

EDA Signal Analysis - A Complete Tour

Navigating through the previous Jupyter Notebooks, provided relevant concepts and methodologies related with the biosignals recording and processing stages. This tutorial joins both stages into a summarized format for the specific case of Electrodermal Activity (EDA).

Open Notebook

BVP Signal Analysis - A Complete Tour

Navigating through the previous Jupyter Notebooks, provided relevant concepts and methodologies related with the biosignals recording and processing stages. This tutorial joins both stages into a summarized format for the specific case of Blood Volume Pulse (BVP) signal.

Open Notebook

Respiration (RIP) Sensor Science Hour

This Jupyter Notebook is an open window to a complete video tutorial about Respiration (RIP) sensor specifications and respective applications.
It was rigorously created by our engineers, we hope that you enjoy!

Open Notebook



Machine Learning

Develop methods for training, classifying, understanding and evaluating data using machine learning techniques.

Rock, Paper or Scissor Game - Train and Classify [Orange]

On the current Jupyter Notebook it will be done a very quick presentation of Orange.

Open Notebook

Rock, Paper or Scissor Game - Train and Classify [Volume 1]

Imagine creating a game that using the signals from your hand can try to guess what is the gesture you are making and play "Rock, Paper or Scissor" game.

Open Notebook

Rock, Paper or Scissor Game - Train and Classify [Volume 2]

After the presentation of data acquisition conditions on the previous Jupyter Notebook , we will follow our Machine Learning Journey by specifying which features will be extracted.

Open Notebook

Rock, Paper or Scissor Game - Train and Classify [Volume 3]

A diversified set of features were extracted in Rock, Paper or Scissor Game - Train and Classify [Volume 3]. However, to avoid redundancies, it is essential to ensure a careful feature selection to guarantee the training of an effective classifier.
Are you ready?

Open Notebook

Rock, Paper or Scissor Game - Train and Classify [Volume 4]

After the previous two volumes of the Jupyter Notebook dedicated to our "Classification Game", we are reaching a decisive stage: Training of Classifier.

Open Notebook

Rock, Paper or Scissor Game - Train and Classify [Volume 5]

At our final volume (current Jupyter Notebook ) an evaluation methodology will be described taking into consideration a particular cross-validation technique.

Open Notebook

Signal Classifier - Distinguish between EMG and ECG

After our introductory set of Jupyter Notebooks, dedicated to Machine Learning concepts, this tutorial is focused on presenting another practical application of a classifier. The trained system is capable of distinguish two physiological signals.

Open Notebook

Train a model for detecting the fist activity using Naive Bayes

Machine-learning applications are endless!
This Jupyter Notebook contains a comprehensive explanation of how to train a Naive Bayes classifier to automatically detect the fist activity, using EMG signals as the source of the training data.

Open Notebook