Nonstationarity: patching

Next: Designing a separate filter Up: PATCHING TECHNOLOGY Previous: Weighting and reconstructing

## 2-D filtering in patches

A way to do time- and space-variable filtering is to do invariant filtering within each patch. Typically, we apply a filter, say , in each patch. The composite operator, filtering in patches, , is given by

 (2)

I built a triangular weighting routine tentn() that tapers from the center of the patch of the filter's outputs towards the edges. Accomplishing this weighting is complicated by (1) the constraint that the filter must not move off the edge of the input patch and (2) the alignment of the input and the output. The layout for prediction-error filters is shown in Figure 4.

rabdomain
Figure 4.
Domain of inputs and outputs of a two-dimensional prediction-error filter.

rabtent
Figure 5.
Placement of tent-like weighting function in the space of filter inputs and outputs.

We need a weighting function that vanishes where the filter has no outputs. The amplitude of the weighting function is not very important because we have learned how to put signals back together properly for arbitrary weighting functions. We can use any pyramidal or tent-like shape that drops to zero outside the domain of the filter output. The job is done by subroutine tentn(). A new parameter needed by tentn is a, the coordinate of the beginning of the tent.
user/gee/tent.c
  /* loop in the window */ for (i=0; i < nw; i++) { sf_line2cart(dim, nwind, i, x); windwt[i] = 1.; for (j=0; j < dim; j++) { if (x[j] >= start[j] && x[j] <= end[j]) { w = (x[j]-mid[j])/wid[j]; windwt[i] *= SF_MAX(0.,1.-fabs(w)); } else { windwt[i] = 0.; } } } 

In applications where triangle weights are needed on the inputs (or where we can work on a patch without having interference with edges), we can get triangle tent'' weights from tentn() if we set filter dimensions and lags to unity, as shown in Figure 6.

wind1wt
Figure 6.
Window weights from tentn() with nwind=(61,19), center=(31,1), a=(1,1) .

Triangle weighting functions can sum to a constant if the spacing is such that the midpoint of one triangle is at the beginning of the next. I imagined in two dimensions that something similar would happen with shapes like Egyptian pyramids of Cheops, . Instead, the equation which has the tent-like shape shown in Figure 6 adds up to the constant flat top shown in Figure 7. (To add interest to Figure 7, I separated the windows by a little more than the precise matching distance.) In practice we may chose window shapes and overlaps for reasons other than the constancy of the sum of weights, because mkwallwt accounts for that.

wall1wt
Figure 7.
(Inverse) wall weights with n1=100, w1=61, k1=2, n2=30, w2=19, k2=2

Finally is an example of filtering a plane of uniform constants with an impulse function. The impulse function is surrounded by zeros, so the filter output patches are smaller than the input patches back in Figure 3. Here in Figure 8, both axes need more window density.

cinloip
Figure 8.
Filtering in patches Mid with the same parameters as in Figures 2 and 3. Additionally, the filter parameters are a1=11 a2=5 lag1=6 lag2=1 . Thus, windows are centered on the 1-axis and pushed back out the 2-axis.

 Nonstationarity: patching

Next: Designing a separate filter Up: PATCHING TECHNOLOGY Previous: Weighting and reconstructing

2013-07-26