CONVOLVEI (VAR, WEIGHT), CONVOLVEJ (VAR, WEIGHT) ,
CONVOLVEK (VAR, WEIGHT), CONVOLVEL (VAR, WEIGHT) ,
CONVOLVEM (VAR, WEIGHT), CONVOLVEN (VAR, WEIGHT)
Convolve functions, convolve the I (or J,K,L,M,N) component of variable with weight function
Arguments: |
VAR |
COM: variable to convolve |
WEIGHT |
Weight function |
|
Result Axes: |
X |
Inherited from VAR |
Y |
Inherited from VAR |
|
Z |
Inherited from VAR |
|
T |
Inherited from VAR |
This function (and likewise CONVOLVEJ, CONVOLVEK, CONVOLVEL, CONVOLVEM, and CONVOLVEN) convolves the variable VAR, with the weight function, wt along the X (or Y,Z,T,E,F) axis. Note that the variable's context may not be of adequate size for the full calculation. Missing data flags will be inserted where computation is impossible.
When bad data points are encountered in the component data all result data depending on it are flagged as bad, too.
The weight function is applied at each point from i-hlen to i+hlen, where hlen is half the length of the weight function. If the function is of even length, a zero weight is used at the upper end. Thus if the weights were {0.1, 0.4, 0.4, 0.1} the result at point I would be computed as the sum 0.1* COM(i-2) + 0.4* com(i-1) + 0.4* COM(i) + 0.1* COM(i+1) + 0.* COM(i+2)
Example:
Use the function to smooth a variable.
yes? LET weight = {0.25, 0.5, 0.25} yes? LET c = SIN(x[x=0:10:.1]) + RANDU(X[X=0:10:.1])/5 yes? PLOT c yes? PLOT/OVER/TITLE="convolvei" CONVOLVEI(c,weight)