Vous êtes sur la page 1sur 6

Journal of Information, Control and Management Systems, Vol. 1, (2003), No.

51

MEDIAN FILTER
Juraj MIEK, Jn KAPITULK University of ilina, Faculty of Management and Informatics, Department of Technical Cybernetics e-mail: micek@frtk.fri.utc.sk, Jan.Kapitulik@fri.utc.sk Abstract The article describes chosen properties of median filters as well as possibilities of applications of them. Median filters represent nonlinear dynamic systems. Methods of analysis of linear dynamic systems such as: frequency analysis, principle of superposition, impulse response, stability, etc. is impossible to apply for analysis of median filters. That is why the filters are reviewed on the basis of their influence on various types of signals. Key words: median filter, nonlinear dynamic system INTRODUCTION Median filter and modifications of it belong to wide class of filters based on classification of chosen samples collection. Let us remember that measurement. 3-step error filtering process includes: 1. Collection of N values of measured variable. 2. Truncation of maximal and minimal values, i.e. anomalous errors filtering. 3. Calculation of arithmetic average of rest N-2 values, i.e. filtering of errors with Gaussian probability density function (noise temperature and other environmental influences and inaccuracies). Intuitive error filtering approach consists of two sequentially connected filters. First one represents median filter, the second linear FIR filter is based on principle of moving average with samples decimation. Median filter is often used in case of rare impulse errors suppression superposed on useful signal. The filter is very often used in applications of video correction [1]. Low-pass filters are not applicable because of picture edges blurring. 2 EFFECTS OF MEDIAN FILTERS Output sample of linear discrete filter consists of linear combination of previous output samples y(n-i), i represents integer number in range 1 to N, and input samples x(n-k), k represents integer number in range 0 to M. Above mentioned linear 1

52

Median Filter

combination is in case of nonlinear discrete dynamic systems (DDS) replaced with nonlinear function of adequate number of variables. y(n) = F(x(n), x(n-1), , x(n-M), y(n-1), y(n-2),, y(n-N)), (1)

M and N suppose arbitrary positive integer numbers. Let us remark that expression (1) is reduced in case of FIR filters to: y(n) = F(x(n), x(n-1), ..., x(n-M)). (2)

Median filter represents nonlinear dynamic system derived from vector of values x(n) = {x(n), x(n-1), , x(n-M)}T. Output sample of median filter y(n) is defined as middle sample from classified collection of elements of vector x(n). y(n) = med {x(i)}, where i = n, n-1, , n-M (3)

Number of samples of M+1 median filter is often called length D of it, usually expressed by odd number. Length of median filter determines suppression of impulse errors with various widths. Let us remark that practical applications use various derivates of basic median filter based on expression (3), e.g. weighting median filters, recursive median filters [2], multidimensional median filters [1], etc. More detailed information about architectures and implementations of median filters are presented in [3]. Following figures depict influence of median filter on several input signals. Figure 1 depicts effect in case of harmonic input signal. Spectral density functions of input as well as output signals are presented. It is possible to notice existence of higher harmonics of output signal, what is typical feature of nonlinear systems. Median filter length is equal to 25. Figure 2 depicts improved harmonic output signal (from distortion point of view) compliant with reduction of median filter length, D=5. Figure 3 depicts effects of median filter in case of random input signal with Gaussian probability density function. Median filter represents imperfect low pass filter. Figure 4 depicts median filter effects in case of rectangular input signal. On the basis of experiments, it is possible to state that semi-constant signal is not garbled by median filter. Output signal is only delayed by (D-1)/2 sampling period.

Journal of Information, Control and Management Systems, Vol. 1, (2003), No.2

53

Figure 1 Time behaviour of input and output signals in case of median filter with length D = 25

Figure 2 Time behaviour of input and output signals in case of median filter with length D = 5

54

Median Filter

Figure 3 Effect of median filter in case of random signal (D=5)

Figure 4 Effect of median filter in case of rectangular signal (D=5) If impulse disturbance is superposed on useful signal median filter will be able to suppress superposed errors. Impulse errors with various widths are superposed on rectangular signal and depicted in Figure 5. Width of the first impulse is equal to 1 sample, the second to 3 samples, the third to 5 samples, etc. Median filter with length D=3 is able to suppress only first impulse. Suppressing of wider impulses requires

Journal of Information, Control and Management Systems, Vol. 1, (2003), No.2

55

increasing of filters length D, Figure 6: D=19. Applied filter suppressed even the widest impulse of 9 samples. Proper length of median filter is calculated on the basis of following formulas: D = 2N + 1 , D = (2T/Ts) + 1 , N = expected number of samples per impulse error T = expected time duration of impulse error Ts = sampling period.

Figure 5 Effect of median filter in case of impulse error (D=3)

Figure 6 Effect of median filter in case of impulse error (D=19) 3 CONCLUSION Median filters do not replace linear discrete ones. Fields of applications are compliant with basic characteristics of them. The filters could be applied in case of filtering of impulse errors in industry environment. They are often applicable in video signal processing, diagnostic in healthcare systems, etc. High speed signal processing is characteristic for median filters because of their simple technical realization.

56

Median Filter

REFERENCES [1] Koschman A.,Abidi M.: A Comparison of Median Filter Techniques For Nois Removal in Color Images, Report University of Erlangen-Nurnberg, Vol.34, No 15, 2001 [2] tork M.: Medinov filtr a jeho pouit, Kybernetika, ilina 2002, ISBN 80967609-7-1 [3] Kov O., Jurek J.: FPGA Implementation of Median Filter, IEEE Applied Electronics 2002 Referee: Branislav Dobruck

Vous aimerez peut-être aussi