Why do we cascade a median filter and a moving average filter?
I know how each filter performs, but I do not know the difference between these two filters in denoising application and what is the effect of cascading them?
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It only takes a minute to sign up.
Sign up to join this communityWhy do we cascade a median filter and a moving average filter?
I know how each filter performs, but I do not know the difference between these two filters in denoising application and what is the effect of cascading them?
You may look at it as an outlier rejection step.
We can visualize it by a simple example.
Assume that we have a signal from a DC source with added Gaussian White Noise.
Assume the signal has 10 samples.
In order to estimate the DC level one can calculate the mean of those samples.
Now assume there is a single sample which is corrupted by a big outlier value.
Now if we calculate the mean of the samples the output is deviated by the outlier sample.
By applying the median filter we minimize the effect of the outlier and then the output of the mean filter is stabilized.
In the context of Denoising the median filter is considered an Edge Preserving Filter. Because of its ability to remove Salt and Pepper like noise (Impulse noise) while preserving details (Piece Wise Smooth model).
So you may think of this operation as filtering impulse noise and then filtering wide band noise given our data model is relatively narrow band.
A sliding median filter can and does have some jump discontinuities in its output. A sliding average filter is an LTI low-pass filter and any jump discontinuity will become a sloping function that moves toward the final value.
So the averaging filter is there just to smooth things out. But the result really is a median result, and being a median, will not be affected by extreme outliers, whereas if the median filter was removed, the output of the sliding average definitely would be affected by extreme outliers.