Date: Mar 4, 2011 10:56 AM
Author: Cameron
Subject: Re: anybody got a complex 2-D median filter script they can share?

"Matt J" wrote in message <ikr1fs$2g0$>...
> "Matt J" wrote in message <ikr10v$2e3$>...
> >
> > > I am in a bit of a time crunch and am looking for a script to handle 2-D complex data with a median filter. long story short I've been doing the operation wrong and getting good results with bad math. any assistance is appreciated!
> > ============
> >
> > median filtering relies on the ability to sort/order the input data. Since your data is complex valued, how would you define an ordering for it, on which to base calculations of the medians?

> ====================
> If you mean that you just want to median filter the real and imaginary part of the image separately, you could just do
> X_filtered = medfilt2(real(X))+i*medfilt2(imag(X));

Thats essentially what I was doing before. I think it violates some part of signal processing to do it that way though and is just filtering out a bunch of stuff I don't want serendipitously. I am trying to preserve a phase characteristic of the complex imaginary data. there are a few papers on IEEE about the application for complex weighted median filters, but frankly I don't think I have time to digest the math and get a script written.