CDFSMOOTH

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE

NAME

cdfsmooth −− low pass filter

SYNOPSIS

cdfsmooth index_var1 lambda1 [index_var2 lambda2 ... lambda4]

DESCRIPTION

Cdfsmooth low pass filters all fields extending over the domain indicated by the index fields mentioned on the command line. The input field is read from the standard input and the output is written to the standard output.

The algorithm used by cdfsmooth is as follows: Defining alpha(i) = (index(i−1) − index(i))/lambda where index(i) is the value of the index field in the ith position, then intermed(i) = alpha(i)*raw(i) + (1 − alpha(i))*intermed(i−1). Finally, smooth(i) = alpha(i+1)*intermed(i) + (1 − alpha(i+1))*smooth(i+1). In these calculations, "raw" is the raw field input, "intermed" is an intermediate result, and "smooth" is the final result. The above sequences are initialized by setting "smooth" and "intermed" to raw data values at the starting boundaries. If bad data intervenes, the calculation is restarted after the bad data. The value of alpha is limited to the interval [0, 1].

Lambda*2*pi may be interpreted as the half−amplitude wavelength for the low pass filtering.

EXAMPLE

kestrel%cdfsmooth x .1 y .01 < input_file > output_file

In this example all fields extending over x and y are smoothed, with lambda = .1 for x, and lambda = .01 for y.