Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
extrema / usr / share / extrema / Help / Functions / smoothS01.htm
Size: Mime:
<HTML>
<HEAD>
<TITLE>2D smoothing</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" fgcolor="#000000">

<P><A NAME="bivsmooth"></A>
<font size="+3" color="green"><B>2D smoothing</B></font></P>
<P>
<TABLE border="1" cols="2" frame="box" rules="all" width="572">
<TR>
<TD width="15%" valign="top"><B>Syntax</B>:</TD>
<TD width="85%"><CODE>
wout = BIVSMOOTH(x,y,z,mx,my)</CODE>
</TD></TR>
</table></p>
<p>
 This function fits a smooth surface of a single-valued bivariate function z = z(x,y) to a set of input data
 points given at input grid points in an x-y plane.  It generates a set of output grid points by equally
 dividing the x and y coordinates in each interval between a pair of input grid points, interpolates the z
 value for the x and y values of each output grid point, and generates a set of output points consisting of
 input data points and the interpolated points.  The method is based on a piece-wise function composed of
 a set of bicubic polynomials in x and y.  Each polynomial is applicable to a rectangle of the input grid
 in the x-y plane.  Each polynomial is determined locally.</P>
<P>
 The first two parameters are vectors. Vector <CODE>x</CODE> contains the x-coordinates of the input
 grid points, in ascending or descending order. Vector <CODE>y</CODE> contains the y-coordinates of the
 input grid points, in ascending or descending order.  Both <CODE>x</CODE> and <CODE>y</CODE> must be
 monotonic.  The third parameter is a matrix, <CODE>z</CODE>, which contains the values of the function
 at the input grid points, <CODE>z[i][j]</CODE> is the data value at <CODE>(x[i],y[j])</CODE>.  The last two
 parameters are scalars. The fourth parameter, <CODE>mx</CODE>, is the number of subintervals between
 each pair of input grid points in the x direction, and must be at least 2. The fifth parameter,
 <CODE>my</CODE>, is the number of subintervals between each pair of input grid points in the y direction,
 and must be at least 2.  The result of the function is a matrix, <CODE>wout</CODE>, which has
 <CODE>my*(LEN(y)-1)+1</CODE> rows and <CODE>mx*(LEN(x)-1)+1</CODE> columns.  The first row of the matrix,
 starting in column 2, contains the x coordinates of the output values.  It can be extracted into a vector,
 <CODE>u</CODE>, with the following:</p>
<p>
 <CODE><font color="blue">u = wout[1,2:VLEN(wout)[2]]</font></CODE></p>
<p>
 The first column of the matrix, starting in row 2, contains the y coordinates of the output values.
 It can be extracted into a vector, <CODE>v</CODE>, with the following:</p>
<p>
 <CODE><font color="blue">v = wout[2:VLEN(wout)[1],1]</font></CODE></p>
<p>
 The smoothed values at the <CODE>(u,v)</CODE> locations can be extracted into a matrix, <CODE>w</CODE>, with
 the following:</p>
<p>
 <CODE><font color="blue">w = wout[2:VLEN(wout)[1],2:VLEN(wout)[2]]</font></CODE></p>
<p>
 For example, suppose <CODE>x</CODE> and <CODE>y</CODE> are vectors and
 <CODE>m</CODE> is a data matrix with <CODE>LEN(y)</CODE> rows and <CODE>LEN(x)</CODE> columns:
 <font color="blue"><PRE>
 nx = 5 ! number of subdivisions in x
 ny = 4 ! number of subdivisions in y
 ww = bivsmooth(x,y,m,nx,ny)
 u = ww[1,2:VLEN(ww)[2]]
 v = ww[2:VLEN(ww)[1],1]
 w = ww[2:VLEN(ww)[1],2:VLEN(ww)[2]]
 </PRE></font></P>
<P>
 Algorithm derived from an article by Hiroshi Akima, <b>Communications of the ACM</b>, volume 17, number 1,
 January 1974, pp. 26-31.</P>
<P>
  <a href="smooth.htm"><img align="top" border="0" src="../shadow_left.gif">&nbsp;
    <font size="+1" color="olive">Smoothing</font></a></P>
</BODY>
</HTML>