How to use FFT to filter 50 Hz noise from a data array?

Suppose I have an array of ECG data like this

http://joachim.behar.perso.neuf.fr/Joachim/ECG_tuto_1/ECG_filters_basics/ecg_sample.txt

and I need to filter out 50 Hz noise from it using such an algorithm

http://joachim.behar.perso.neuf.fr/Joachim/ECG_tuto_1/ECG_filters_basics/notch_filter.m

and the result should be like this (red - filtered, blue - unfiltered), seen in Figure 2 :

enter image description here

What would be the best way to do this in Java / android? Will this library help https://sites.google.com/site/piotrwendykier/software/jtransforms ?

Thanks! )

+6
source share
1 answer

In the article, elementary ECG filtering in the (numbered) section applies filter removal to remove noise from the power line; The result is displayed in Figure 2 . This Java ImageJ plugin , Notch_Filters , "implements the most common Notch filters in the frequency domain." Although this example is not a direct port to Android, it may allow you to choose a specific implementation for re-implementation.

Please note that this article extends the limitations of the approach.

Addendum: The filter notch uses an FFT, so you will need both.

+2
source

Source: https://habr.com/ru/post/928186/


All Articles