I have a noisy signal with jumps to high value and back to normal for limited time bins (40 for example) which I want to filter to have a smooth signal with no jumps. Here is the graph, the blue one.

enter image description here

I tried moving average filter (n=20), the green one. Also tried window based (kaiser) LPF with cut-off freq=0.01 (I choose it manually) but still the filtered signal follows the jumps.

Also I tried to flatten the signal by using the average of the past n values whenever there is a jump. But how could I find the start of a jump. I need a threshold. Also there is difficulty with determining the end of a jump. I need another threshold.

  • Is there any way to filter the signal in a way that it doesn't follow the jumps?
  • Are those jumps and falls caused by low frequencies, since LPF don't eliminate them? So I should use high pass filter? I am confused.

EDIT: Another graph that shows what I want to eliminate (the gray regions).

enter image description here

  • $\begingroup$ @yassermazdeh I have a similar problem. can you tell us how you found the correct median filter parameters to use? a methodology would help? Best Regards RC $\endgroup$
    – user37859
    Commented Sep 24, 2018 at 15:56
  • $\begingroup$ @YasserMZadeh sorry I got your name wrong. I have a similar problem. I am curious how you found the correct median filter parameters to use. A methodology would help. $\endgroup$
    – user37859
    Commented Sep 24, 2018 at 15:58
  • $\begingroup$ @rch Welcome to SE.SP! Please ask your own question showing examples of the data that you are using. Also, please do not post comments as answers. That is not looked upon favorably by the SE system. Work at getting reputation, first! $\endgroup$
    – Peter K.
    Commented Sep 24, 2018 at 18:58

1 Answer 1


I think that you will not be able to get acceptable results with linear filtering because the impulse noise covers the whole frequency range. You may want to look into nonlinear filtering techniques. As a first (and simple) approach try median filtering: http://en.wikipedia.org/wiki/Median_filter

I think if you optimize the window size of the median filter you should get better results than with purely linear filtering.

  • $\begingroup$ Thank you very much. It solved my problem. How did you know that the noise covers whole frequency range? here is the FFT of that signal. $\endgroup$
    – Yasser
    Commented Apr 16, 2013 at 13:35
  • 2
    $\begingroup$ @YasserMZadeh: The noise is made up of impulses, which have a wideband spectrum $\endgroup$
    – endolith
    Commented Apr 17, 2013 at 23:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.