Re: Median filter in Verilog



john wrote:

I am trying to design a median filter in Verilog. There are plenty of
papers on median filter designs for image/audio applications. However,
I cannot find any starting point for a median filter which needs to
sort 100 numbers (14bit wide each).

My favorite architecture for such processors is the
systolic array, which may or may not be useful in this case.

First thought is that, given an already sorted array you
remove one point and add the new one in the appropriate position.
(Note that http://en.wikipedia.org/wiki/Median_filter says
you should have an odd number, and 100 isn't odd.)

The sort/insert should be done in a fixed number of clock
cycles, like one or two. That would seem to require N
comparators, and N bit priority encoder, and N multiplexers
to shift and insert as appropriate. That sounds like a lot
of logic, but it shouldn't be hard in a reasonable sized
ASIC or FPGA to fit it in. It requires signals going
long distances across the array, which might slow it
down too much.

My first thought on seeing Median was an algorithm
in Knuth, "The Art of Computer Programming," vol. 3,
on an O(n) algorithm for median that doesn't sort
the whole array.

A systolic array solution isn't immediately obvious,
but that might work better for high speed processing.
It might be that the algorithm in Knuth could be
implemented in some type of parallel array not
requiring long distance communication.

-- glen

.



Relevant Pages

  • Re: Fundamental frequency -- limited resources
    ... Why is a median filter not good enough? ... your sorted array. ... > constraint, the processor horsepower is not as big a constraint. ... > keep thinking, "if I could just do an FFT and take the dominant freq, ...
    (sci.math.num-analysis)
  • Re: Okay to move an "object" will-nilly?
    ... I wrote a funky kind of algorithm for sorting an array (whether ... the objects in the array must be move safe. ... the array was already sorted so no swaps were performed by the sort. ...
    (comp.lang.c)
  • Re: Fastcode poll - Should Sort include worst case situations
    ... median algorithm, not O), there exists sequences that will beat ... quicksort and make it O. ... by many compiler vendors is "Engineering a Sort ... If it detects that a portion of an array is responding badly, ...
    (borland.public.delphi.language.basm)
  • Re: Hash table in C++? STL?
    ... The Oalgorithm is when you scan all ... > Assume array a and b both have N elements, ... > Will a binary search beat a hash lookup? ... Running time O) for the sort if using ...
    (comp.lang.cpp)
  • Re: Sorting
    ... The easiest, probably, is to go through the array. ... This algorithm is called bubblesort. ... less efficient than selection sort or insertion sort, ... What memory management is below? ...
    (comp.lang.c)

Loading