Conventional MF is based on a scalar-value sorting process. When a set of scalars is sorted to form an ascending or descending sequence, the middle value is chosen as standard for this sequence. In signal-processing or geophysical data analysis fields, this filter is commonly used to remove spiky noise. The more general mathematical formulation of a MF is given as:
(1)
where
is the output value for location
;
,
and
are the position indices in a 2-D profile; and
and
are both indices in the filtering window.
is the length of the filtering window and
denotes
norm. Commonly,
corresponds to a standard MF.