# On the time-frequency relationships of median filters

I'm applying Matlab's median filter to a data sequence and I'm trying to figure out what filter co-efficients of a linear filter this corresponds to.

Would the normal time-frequency relationship that exists for linear filters maintain itself for the median filter?

• Can whoever down-voted this question please provide an explanation for why? May 5 '12 at 4:39
• Op needs to use the Matlab documentation, median filter is there. In addition, this question is poorly phrased and is unclear (without reading through 3-5 times) what the OP is asking. May 7 '12 at 13:36
• @CyberMen Thank you CyberMen, I have edited his/her question to make it clearer. May 7 '12 at 16:37

The median filter is actually an example of a non-linear filtering operation.

This stands in contrast to linear filtering operations (the 'classical' way that involve the convolution of a filter's co-efficients with a signal). Since convolution in time is the same as multiplication in the frequency domain, you can go back and forth between the domains to figure out co-efficients of your filter in either basis.

However, since medial filtering is a non-linear operation, you cannot do this. There is nothing you can convolve your signal with (ie, no linear operation you can do on your signal) such that you would get the same result as you see by using the non-linear medial filter.

• shoot that is not good, so is there a list of the linear filters somewhere? Are they just the low-pass/high-pass filters? And how exactly do I find their coefficients? Thanks. May 5 '12 at 1:14
• @Zaubertrank There is no list. Or if there is, it is as long as all the real numbers in the universe. :-) Any vector can be a linear filter. [1 0.9 -9 1.4 2] is a linear filter. They will all manipulate your signals' frequency spectrum in some way, (high pass, low pass, band pass, notch, a combination, etc). What are you trying to do? You can make a new question and accept an answer on this thread. May 5 '12 at 1:18

Besides being non-linear, a median filter is also an informationally lossy filter. It gives you a potentially smoother waveform with less extrema by throwing information away. Thus, the original waveform can't be recovered. (e.g. multiple input signals can produce the exact identical output. There's no information left in the output to determine which possible input the inverse could be.)

Another way to look at an N-tap median filter is the multiplexing of the outputs of N different linear filters. There's no single linear filter that can represent mixing up the results of N different filters.

• Hmm, wouldn't the information-loss criteria be true of most, if not all classical filtering operations as well? I dont think this is unique to non-linear medial filters hotpaw2. May 5 '12 at 0:37
• Linear filters a lossy around their poles or zeros. May 5 '12 at 0:39
• Can you expand on what you mean by 'lossy' here - from the information perspective all filters are lossy in this sense, if we are considering information. May 5 '12 at 0:42
• @Mohammad : Are you discussing numerical precision effects? Or stating that no classical filter has an inverse? May 5 '12 at 1:30
• No, still talking theoretical. I am trying to ascertain what you mean by lossy in this context. The way I see it all filters are 'lossy' in that they will destroy information in some way. I agree with you that there is no way to invert a medial filter, (whereas we can invert classical ones). Is this what you mean by 'lossy'? We might just be talking past each other if that is the case. :-) May 5 '12 at 1:41