Triangle Smoothing

A box filter can be defined in the Z-transform notation as follows (Claerbout, 1992):

$\displaystyle B(Z) = \frac{1}{N} (1 + Z + Z^2 +\cdots+Z^{N-1}) = \frac{1-Z^N}{N(1-Z)},$ (1)

$\displaystyle Z = e^{i\omega\Delta t},$ (2)

where $N$ is the number of samples included in a moving average under a rectangle window, $\omega$ is the frequency in radians, and $\Delta t$ is the interval spacing in time. Division by $(1-Z)$ is the operation of causal integration and corresponds to the following recursion in time:

$\displaystyle y_t = y_{t-1}+x_{t-1}.$ (3)

The adjoint of this operation is anti-causal integration, or division by $(1-Z^{-1})$, and is represented by the backward recursion in time:

$\displaystyle y_{t-1} = y_{t}+x_{t}.$ (4)

A triangle filter is defined as the cross-correlation of two box filters (Claerbout, 1992)

$\displaystyle T(Z) = B(Z)B(Z^{-1}) = \frac{(2-Z^N-Z^{-N})}{N^2(1-Z)(1-Z^{-1})}.$ (5)

$N$ becomes the triangle smoothing radius, or half the number of points included in a moving average under a triangle window. The numerator in 5 is represented by the following filtering operation:

$\displaystyle y_{t} = 2x_t-x_{t-N}-x_{t+N}.$ (6)

Triangle smoothing is efficient because it requires at most five additions and one multiplication for each time sample regardless of the size of the triangle smoothing radius. To summarize, triangle smoothing is implemented in time by the following four steps in any order: (1) three-point filtering following equation 6, (2) causal integration following equation 3, (3) anti-causal integration following equation 4, and (4) division by $N^2$. By expanding $Z$ and redefining the triangle smoothing radius as $R$, we can redefine a triangle filter as a function of smoothing radius and frequency

$\displaystyle T(R,w) = \frac{1}{R^{2}}\left[\frac{2-2\cos(Rw\Delta t)}{2-2\cos(...
...}}\left[\frac{\sin^2(\frac{Rw\Delta t}{2})}{\sin^2(\frac{w\Delta t}{2})}\right]$ (7)

In practice, smoothing with a non-integer radius is implemented using interpolation between two triangles with the nearest integer radii (Fomel, 2016).


2024-07-04