Biosignals Processing 101: Pre-Processing - Removing noise from raw biosignals

Introduction

Welcome back to our blog series covering the fundamentals of biosignals processing. In our last blog post, we learned about the different sources of noise and noise types.

And now that we understand our noise sources we can avoid it altogether If the noise source can be avoided altogether… right?

Unfortunately, this is not always possible as you might not be able to isolate your acquisition setup into perfectly noise-free environments. You’re also not able to avoid certain body parts or organs that are the source of your noise. However, once you understand the noise and are able to characterize it, you can use the following tools to find filters that work for your noise.

This process of the signal processing change is called Pre-Processing and lays the foundation for extracting valuable insights from these intricate physiological signals by cleaning recorded raw biosignals from artifacts and unwanted noises and interferences.

In this blog post, we’ll have a look at different types of filters, when they are useful, and what are popular filters used in biosignal processing. We’ll also provide our biosignals Notebooks which are Python Notebooks designed for you to gain hands-on biosignals experience by working with filters yourself.

 

Filters: What types and when to apply

Low-Pass Filtering: Preserving Slow-Changing Signal Components

Low-pass filtering is a technique designed to allow low-frequency components to pass through while attenuating higher-frequency components. In biosignal processing, low-pass filters are commonly used to remove high-frequency noise and irrelevant interference, preserving the essential slow variations of the signal. This is particularly useful in applications like Electrocardiography (ECG) to eliminate high-frequency muscle noise, enabling clear visualization of heart activity.

High-Pass Filtering: Preserving Fast-Changing Signal Components

High-pass filtering, on the other hand, allows high-frequency components to pass while suppressing lower-frequency components. By applying high-pass filters, you can isolate and extract rapid changes or transient events in the signal, effectively removing baseline drifts and slow trends. This technique is instrumental in Electroencephalography (EEG) to focus on brainwave activities while suppressing slow eye movement artifacts or to remove respiratory impacts on ECG sensor data.

Bandpass Filtering: Preserving Selected Frequency Ranges

Bandpass filtering combines the characteristics of both low-pass and high-pass filters to allow only a specific range of frequencies to pass through. This method is beneficial when dealing with biosignals that exhibit relevant information within a particular frequency band. For instance, in ECG signals, bandpass filters can remove both low-frequency baseline wandering effects and high-frequency muscle activity from the ECG sensor data, leaving only the relevant ECG signal in between intact.

Notch Filtering: Eliminating Specific Frequencies

Notch filtering is a technique designed to target and eliminate specific frequencies, typically those originating from powerline interference or other unwanted sources. This filtering method is especially useful in biosignal processing when dealing with 50Hz or 60Hz powerline noise, which can contaminate the data and hinder accurate analysis.

Popular filter options for low-, high- and the combined bandpass filter in biosignal processing have already been established and can be suitable for a wide range of applications. The best choice of filter is often in the hand of the user (you), as it depends on what type of information you expect to extract from your biosignals.

Nevertheless, we leave you here some pointers to the most popular options with their benefits and downsides for your evaluation:

Butterworth Filter: Butterworth filters are commonly used in biosignal processing as they provide a smooth frequency response in the passband and are easy to implement. Researchers can choose different orders of Butterworth filters to control the roll-off steepness, i.e. how quickly the filter attenuates frequencies beyond the passband. If not selected wisely, this filter can have a gradual roll-off, allowing some unwanted frequencies to pass through.

Chebyshev Filter: Chebyshev filters are also widely used in biosignal processing because they have a sharper drop-off for blocking unwanted frequencies compared to Butterworth filters. However, they might introduce some wavy patterns in the signals they allow to pass through, which may affect signal accuracy.

Elliptic Filter (Cauer Filter): The elliptic filter, also known as the Cauer filter, is a versatile option that provides a sharp roll-off and a flat passband response, making it useful in applications that require aggressive noise removal. While providing a sharp roll-off, it can have ripples both in the passband and stopband.

Finite Impulse Response (FIT) Filter: FIR filters are non-recursive, meaning they don't rely on past output samples, and they provide a linear phase response, preserving the timing relationships of different signal components. FIR filters are particularly valuable when we require precise control over the filtering process to avoid introducing phase distortions or signal delays. Longer filter lengths may lead to higher computational requirements.

Wavelet Transform: While not a traditional filter, the wavelet transform is an alternative as it decomposes the signal into different frequency components, therefore allowing it to highlight (e.g. R-Peaks in ECG signals) or suppress signal components of interest. Wavelets require careful selection of wavelet basis and decomposition levels, affecting analysis accuracy.

 

Python Notebook on Pre-Processing

We’ve prepared the following biosignals Notebook for a hands-on experience with signal pre-processing. This Notebook uses a noise Electrocardiography (ECG) sample signal and demonstrates how we can apply filters to remove the noise so that we end up with a clean ECG for the next processing steps.

Looking for more real-world examples? See how these techniques can be applied to real-world raw Electroencepholagraphy (EEG) signals and other filtering techniques with examples of Electrocardiography (ECG) and Electromyography (EMG) sensor data.