4
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ Can whoever down-voted this question please provide an explanation for why? $\endgroup$ – Spacey May 5 '12 at 4:39
  • $\begingroup$ 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. $\endgroup$ – CyberMen May 7 '12 at 13:36
  • $\begingroup$ @CyberMen Thank you CyberMen, I have edited his/her question to make it clearer. $\endgroup$ – Spacey May 7 '12 at 16:37
11
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – Zaubertrank May 5 '12 at 1:14
  • 1
    $\begingroup$ @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. $\endgroup$ – Spacey May 5 '12 at 1:18
3
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ 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. $\endgroup$ – Spacey May 5 '12 at 0:37
  • $\begingroup$ Linear filters a lossy around their poles or zeros. $\endgroup$ – hotpaw2 May 5 '12 at 0:39
  • $\begingroup$ 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. $\endgroup$ – Spacey May 5 '12 at 0:42
  • $\begingroup$ @Mohammad : Are you discussing numerical precision effects? Or stating that no classical filter has an inverse? $\endgroup$ – hotpaw2 May 5 '12 at 1:30
  • $\begingroup$ 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. :-) $\endgroup$ – Spacey May 5 '12 at 1:41

Your Answer

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

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