0% found this document useful (0 votes)
60 views4 pages

Robust Median Filter With Adaptive Window Length: Risto Estola'

This document presents a new approach to median filtering with an adaptive window length. The adaptive window exploits the noise rejection of long windows and edge preservation of short windows. It detects discontinuities by monitoring the stationarity of signals within the window. The distance between the moving mean and median indicates non-stationarities, and the window size is adapted accordingly. This balances noise removal and edge preservation better than fixed window lengths. An efficient algorithm called the multi-resolution histogram method allows practical implementation of the adaptive median filter.

Uploaded by

tiago
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views4 pages

Robust Median Filter With Adaptive Window Length: Risto Estola'

This document presents a new approach to median filtering with an adaptive window length. The adaptive window exploits the noise rejection of long windows and edge preservation of short windows. It detects discontinuities by monitoring the stationarity of signals within the window. The distance between the moving mean and median indicates non-stationarities, and the window size is adapted accordingly. This balances noise removal and edge preservation better than fixed window lengths. An efficient algorithm called the multi-resolution histogram method allows practical implementation of the adaptive median filter.

Uploaded by

tiago
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Robust Median Filter with Adaptive Window Length

Risto Suoranta and Kari-Pekka Estola'

Machine Automation Laboratory, Technical Research Centre of Finland


P.O. Box 192, SF-33101 Tampere, Finland, Tel $358-31-163636, Fax $358-31-163491,
Internet: [email protected]
'Computer Technology Laboratory, Technical Research Centre of Finland
P.O. Box 201, SF 90571 Oulu, Finland, Tel +358-81-509480, Fax $358-81-509680,
Internet: Kari-Pekka.EstolaQ tk0.v tt. fi

Abstract dow. It would be desirable to apply a long data window


to the data segments with stationary data and during
discontinuities decrease the length of the window to the
This paper presents a new approach to reject minimum window length according to the shortest pulse
noise from tlie data wliile preserving disconti- to be passed through tlie filter. Using this kind of ai)-
nuities. The given method exploits tlie noise proach we could achieve high noise rejection aiid still
rejecting properties of tlie long window sizes preserve discontinuities in signals.
aiid tlie edge preservation of tlie short windows.
Adaptive window leiigtlis reduces tlie variance In this paper we introduce a new a d a p l i u e ~ i i e d i a i i
of the filtered signal considerably without de- filler algorithm wliicli elliciently exploits the betiefits
grading tlie accurate reprcsentation of the dis- of the variable size data window. In this presentation
continuities. Finally, a computationally efficient we propose a new procedure to detect tlie discontinu-
implementation of tlie proposed adaptive me- ities and to adjust the length of the window during
dian filtcr is prescxitcd. transients. Transients can be detected within the data
window by monitoring tlie stationarity of tlie signal.
This can be accomplished by observing tlic changes i n
the probability density function ( p d J computed frorn
Introduction the data window. A good estimate of the statioiiar-
ity can be obtained by monitoring the moving mean
I n recent years nonlinear signal processing methods and median of the data. Because the median is a iiiorc
have reached increasing popularity especially in digital robust estimate of mode than the mean, the distaiicc
image processing. Median operation is a widely used between these estimates is related to the certain typcs
nonlinear operator in data processing. Although me- of nonstationarities in the signal. It is shown i n tlie
dian operation is nonlinear, theoretical studies and ex- paper that the adaptation of tlie window size caii I x
periments have revealed some of its fundamental prop- successfully achieved by utilizing tlie distance betwecii
erties wliicli can be exploited in signal processing appli- the mean and median. Examples show how tlie novel
cations. Particularly, in cases where noise rejection is algorithm outperforms the conventional median opera-
needed but sharp edges in signals have to be preserved, tion for nonstationary signals.
median filtering has shown its usefulness. To be able to construct an adaptive window lengtli
To obtain a statistically good estimate of the median, median filter in practice, we need an efficient algoritliin
the length of the data window used i n the estimation and implementation for a median filter togetlier w i t l i
liave to be suffciently long. I n practice the long data the capability to modify the size of the wiiidow Iciigtli
witidow reduces the variance of the nicdian estimate during the processing. A median algoritlim called tlic
mulliresolulton hislogram method (11-[3] is very appro-
and increases tile achieved noise rejection. Unfortu-
priate for the purposes to realize adaptive metliaii fi-
nately tlie noise togetlier with transient events corrupts
ters. 'Tliis is dire to tlic fact that the conipiitnt i l > i i a l
Ilie nietlian estiriiate computed using the long data win-

CH 30064/91/0000-0108 51.000 IEEE


ioriiplexity of the method docs not depend on the num- sponds to the length of the data window - the longer the
ber of sairiples included irk the data window and the window is the longer time we get the erroneous output
Iiiodification of tlic window length can be easily done from the filter. On the other hand short windows result
d U r i iig t lie data processing. in poor estimates of the median during stationary data
segments as seen in the figure.

Window Length in Mode


Estimation

Mode of a probability density function p ( z ) is the value


of t where the function p(t) lias a maximum value.
I f the pdf has more than one peak then several rela-
tive maxima can be found and also as many modes can
be defined. For example, tlie signal having values of
two discrete amplitude levels l i a s a bimodal probability Figure 1: Output of median filter with window length
tlcnsity function ,i.e., signal lias two modes. The first L = 11 (dashed line), L = 80 (dotted line) and adaptive
inode is tlie most likely value for data and thus it can window L = 11, . , . ,80 (solid line).
be considered as a value which best describes the data.
Mode I,,can ,& be defined as
Besides the statistical properties of the estimate, the
length of the data window also affects the width of the
pulses to be passed through the filter. Thus, the im-
Ilue to tlic fact that tlierc is no good way to obtain reli- portant restriction for the window length is the need
ahlc estimate for the mode many alternative parameters to control which transients are regarded as outliers and
are used to replace it. Most frequently used parame- which are classified to be part of the signal. It would be
ters are tlie inean and median. Median is defined as the desirable to apply a long data window to the data seg-
niiddle poiiit of the ranked data and mean is defined as ments with stationary data and during discontinuities
tlie weighted sum of the data points. decrease the length of the window to the minimum win-
dow length according to the shortest pulse to be passed
For sampled data the pdf is usually estimated us-
through the filter. Using this kind of approach we could
iiig hrslogrum h(n). Tlie data is grouped i n h ( n ) to
achieve high noise rejection and still preserve disconti-
N bins witli certain widths W . h ( n ) describes the fre-
nuities in signals.
quency of samples falling in a specified interval n. To
estiinate tlie ruiining ydf from sampled signal we must
selcct the appropriate lengtli for the data window and
establish the liistogram h(n). For piecewise station-
ary data pk(z) varies according to sample index L. In
estimating yk(t) only those samples belonging to the
statioiiary data segment should be used. In practice it Adaptive Median Estimation
is not kiiown where the stationary segments start and
eiitl and therefore we are forced to use a fixed window
lengtli. If we choose a very short data window then a To overcome difficulties, which arises when fixed length
poor estimate for p k ( z ) is obtained. On the other hand data window is applied to the estimation of the me-
the use of very long d a t a windows increases the possi- dian we propose a method in which the data window
bility to have several statistically different sequencies in length is varied according to tlie statistical properties
oiie data window resulting in poor estimates for single of the data. By using the adaptive window length we
aim to enhance the filter performance especially in sit-
l)k(x).
uations where the signal contains step-like changes. I f
Figure 1 illustrates what happens to noisy pulses pro- the data sequence included i n the data window contains
ccsscd with ordinary median operators with different the change from one discrete level to another the pdfof
wiiitlow leiigtlis. From the figure we see that during such data will be a bimodal. As noted above, in the
(lie step froiii one level to another the median operator case of bimodal p d f the median is not a proper estimate
linviiig a long window outputs the biased estimate for for the mode. To minimize the time we obtain the false
t lie traiisiciits occurring inside the data window. The estimate tlie data window length will be reduced for the
(liirntioii of' the biased estiriiate for the nicdian corre- time the transient event is inside the window.

109
Detect ion of nonst at ionarities

To be able to reduce the window length according to


changes in the signal we need a robust method to de-
tect those nonstationary transient events. For station-
ary signals both the mean and the median are good
approximations to the mode. During the discontinu-
ities both estimates fails to follow the mode. However,
the median has a well-known property of edge preser-
vation compared to the mean. Thus by monitoring the
value of a distance between the running mean and me- Figure 2: Adaptive median filter implemeiitatioii.
dian we can efficiently detect nonstationarities caused
by discontinuities of the signal. T h e monitored signal
is defined as is very simple. When the window length is decreased
we just remove two oldest samples from the witidow
eL(k) = Imedian[x(k),L] - m e a n [ z ( k ) ,L]l, without bringing any new values into the window; and
(2) when increasing the window length two new samplcs arc
where L is a window length. Because we are not in- brought into the window and no samples are removed.
terested in which direction the signal is changing the
e L ( k ) is an absolute value of a difference.

Multiresolution Histogram
Controlling window length Realization
Monitored signal e t ( k ) start increase when the front In the proposed median algorithm, the first task is to
end of the data window reaches the transient event and construct the multiresolution histogram. hlultiresolu-
grows as far as the middle point of the window passes tion histogram method sorts the data into a multilevel
by the edge and after that e L ( k ) will decrease towards tree memory. Each tree level contains the moving Iiis-
the end of the window. To know the position of the togram of L data samples. The difference in the res-
window compared to the transient event we actually olution of the histograms between adjacent levels is D
need not to know the distance between the mean and bits and the number of tree levels is M / D , where A i is
median whereas we need to know whether the distance the number of bits to represent the data. In tlie rnul-
is increasing or decreasing. To obtain the information a tiresolution histogram method several histograms arc
derivative of e t ( k ) is extracted using a first difference; computed from the same set of data with diffcrent bin
tliat is, widths W . In the bottom level histogram, the widtli
w ~ ( k= ) e L ( k ) - e L ( k - 1). (3) W,,, = 1, i.e., it has the maximum resolution. I n the
next level W M I D -=~2O and, in general, W, is defined
The actual basis for an adaptation of a data window
as
length will be the sign of w ~ ( k ) . I n Figure 2. the
structure of the proposed filter is depicted. The low- W; = 2(M’D-i)D, i = 1 , . . . , M / D , (4)
pass filter is added to the implementation to obtain
more stable behavior of window length. The optional where i is the histogram level. The histogram data is
small value of A is added to the difference due to the stored in an 2D-ary tree structure.
fact that the maximum length of the window is pre-
ferred in the case of stationary signals. The window The tree update is done in two phases: the oldcst
length is adjusted between a priori set maximum and data sample will be exported out of the tree and tlic
minimum lengths. By choosing the minimum window newest will be imported into the tree. Removing a sani-
length we can control the smallest pulses to be passed ple out of the tree means decrementing the nodes by onc
through the filter. a t each level of the tree and adding a new sample nieaiis
incrementing the corresponding nodes by one.
The window length is changed applying the step size
of two to maintain the proper phase (constant delay) in- For the fast retrieval of the median it is useful to
formation, i.e., the middle point of the window is moved have only few bins. The median search is started from
one sample for each outpbt sample. 0 t h step sizes the top of the tree with the low resolution histograin;
can be also used but by using the step size of two the when the right top level interval is found the senrrlt
procedure to decrease and increase tlie wiiidow length is continued in the next level. The resolutioii of t l i ( ’

110
iiicdiaii cstiiiiate depends on wliicli level tlie search is 4, . . . . . . . . .
s(.opped.

Due to tlie fact that tlic coniputatioiial load of the


iiietliod is iiidcpendeiit of tlic window lengtli L , this ap-
proach is very appropriate for the purposes of the adap-
tive window length realizations. Moreover, the window
lengtli adaptation can be done just by inserting more
samples to tlie tree than we are removing or vice versa. Figure 3: Errors between original signal and filtered
Ilcnioving two old data samples out of the tree without data; L = 80 (dotted line), L = 11 (dashed line) and
inserting any samples means that the length of the data
L = 11,. . . , 80 (solid line).
window is decreased by two and the center of the win-
dow is moved one step ahead. Respectively increasing
the window length by two moves the center one step
ahead.

Numerical Examples
W8UllFdU

To depict tlie effects of different window lengths during Figure 4: Window length (dashed line) and pulse data
the median filtering, a signal containing pulses and ad- (solid line).
ditive noise is filtered applying three different median
sclienies. Figure 1 shows the outputs of two fixed length
median filters having window sizes L1 = 11 (dashed median operator according to the local stationarity of
line) and Lz = 81 (dotted line), and tlie output of the the signal. For stationary epochs of the signal the size
proposed median filter with variable size data window, of the window is large and for nonstationary epochs
L = 11, . . . , $1 (solid line). I n Figure 3 , the correspond- short. An efficient adaptation algoritlim and its real-
ing error signals are plotted. From these figures it can ization was given. Examples show that the new method
be clearly seen that by exploiting the adaptive window outperforms the conventional fixed window length me-
size we can reduce the variance of the filtered signal dian operators.
colisiderably without degrading tlie accurate represen-
tation of the discontinuities. The attenuation of the
noise is -18dD with fixed short window, -6dB with
fixed long window and -22dB with adaptive window
References
lengtli when applied to the example data. In the sta-
tionary segment between two pulses the better noise [l] Kari-Pekka Estola and Risto Suoranta. A fast prob-
rejection ability of presented filter is more clearly seen abilistic median algorithm for integer arithmetics.
- tlie noise rejection by using long data window or
In Proc. Twelfth Gretsi Symposium on Signal and
proposed adaptive window is -37dB and by using the Image Processing '89, pages 61-64, Juan-les Pins,
window size of 11 the attenuation is -19dB. France, Jun, 1989.

Figure 4 depicts the adaptation of the window length [2] Risto Suoranta, Kari-Pekka Estola, and Timo Yli-
using tlie proposed distance measure when applied to Pietila. A novel statistical median-like filter. In
Proc. ISSPA '90, pages 523-626, Gold Coast, Aus-
the original clean data.. The input data to the new
tralia, 1990. IASTED.
adaptive window size median filter is shown as the solid
line aiid tlie resulting window size is given by the dashed [3] Timo Yli-Pietila, Risto Suoranta, and Iiari-Pekka
line. Estola. Configurable hardware implementation of a
fast median algorithm. In Proc. ISSPA '90, pages
815-818, Gold Coast, Australia, 1990. IASTICD.
Conclusions

'Hiis paper introduced a new method to reject noise


f r o n i signals containing sliarp edges or other disconti-
iiuities. l'he proposed mctltod adapts the size of the

111

You might also like