I have a embedded system where I get some type of sensor readings with varying frequency between 0.3 to 1 Hz. Sometimes these readings may have impulse like noise. To filter out this noise, I've implemented a median filter with total 3 data points. Since noisy values does not occur repeatedly, my filter works well except it adds single reading time as delay. The microcontroller that I'm using has limited sources with no Floating-point Unit. I am looking for alternative filters which are closer to real-time and does not consume much resource.

  • $\begingroup$ Is your implementation already tuned to micro-controller specification? Like [Median Filter Performance Results ](embeddedgurus.com/stack-overflow/tag/median-filter) $\endgroup$ Oct 15 '20 at 9:41
  • $\begingroup$ @LaurentDuval Yes, it is. The only reason why I'm looking for an alternative is one sample delay. $\endgroup$ Oct 15 '20 at 9:44
  • $\begingroup$ What kind of CPU is this, and what's your sample data type? $\endgroup$ Oct 15 '20 at 12:23
  • $\begingroup$ Maybe you should consider using median filter with not symmetric window. Anyway, the usual method for removing outlayers is the Hampel filter (also there are some similar alternatives). While median filter modifies the whole signal, the Hampel filter tries to modify the outlayers only $\endgroup$ Oct 16 '20 at 7:17
  • $\begingroup$ @MarcusMüller 32 bit, 32MHz non-ARM architecture MCU with bare-metal written firmware $\endgroup$ Oct 19 '20 at 9:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.