5

Suppose I have a data array from an ECG like this one

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

and I need to filter a 50Hz noise out of it, using an algorithm like that

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

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

enter image description here

What would be the best way of doing it in Java/android? Would this library help https://sites.google.com/site/piotrwendykier/software/jtransforms ?

Thanks! )

Roger Travis
  • 8,402
  • 18
  • 67
  • 94

1 Answers1

2

In the article ECG elementary filtering, a notch filter is applied in the (mis-numbered) section on Removing power line noise; the result is displayed in Figure 2. This Java ImageJ plugin, Notch_Filters, "implements the most common Notch filters in the frequency domain." While the example is not directly portable to android, it might allow you to select a particular implementation to re-implement.

Note that the article expands on the limitations of the approach.

Addendum: The notch filter relies on an FFT, so you'll need both.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • Great suggestion, thanks. Just how would it be getter to implement that notch filter into a common android activity? :) – Roger Travis Oct 20 '12 at 18:01
  • I'm not sure. What activity? EKG? Telephony? What noise? – trashgod Oct 20 '12 at 18:14
  • a simple android activity, that has an array from this file http://joachim.behar.perso.neuf.fr/Joachim/ECG_tuto_1/ECG_filters_basics/ecg_sample.txt and needs to filter off the 50hz noise. – Roger Travis Oct 20 '12 at 18:30
  • Sorry, I'm not sure about an android UI. I'd definitely prototype on the desktop; [tag:jfreechart] is my [favorite](http://stackoverflow.com/a/5048863/230513), and android [ports](http://stackoverflow.com/q/4788576/230513) are available. – trashgod Oct 20 '12 at 22:02