# Kolmogorov–Zurbenko (KZ) filters

The MA (moving average) filter has poor stopband attenuation characteristics, which makes it a poor low pass filter. However, a simple method of improving the stopband characteristics is via a so called Kolmogorov–Zurbenko (KZ) filter, that in essence cascades R identical MA filters of length L into a single polynomial.

$$\displaystyle H(z)=\left[A(z)\right]^R\ =\ \left[\frac{1+z^{-1}+z^{-2}+z^{-3}\ …..\ +z^{-(L-1)}}{L}\right]^R$$

As seen below, the result of the cascade significantly improves the stopband characteristics (even for low values of R), while retaining the highly desirable sharp step response of the MA.

FilterScript provides developers with a simple method of designing KZ filters via the augmentpoly(a,R) function. Where, an input polynomial a is replicated R times, i.e. $$Y(z)=\left[A(z)\right]^R$$  for $$1 \le\ R\ \le\ 10$$. The function will automatically analyse the generated coefficients and remove any leading or trailing zeros.

Example

ClearH1;  // clear primary filter from cascade

interface L = {1,100,2,77};   // model length (order = length - 1)
interface R = {1,10,1,6};    // Number of filters

Main()

Hd=movaver(L,"numeric"); // design moving average
Num = getnum(Hd); // moving average filter coefficients
Den = {1};
Gain = getgain(Hd);      // normalise gain at DC

// Kolmogorov–Zurbenko filter coefficients
Num=augmentpoly(Num*Gain,R);
Gain=1;