Mathematica 9 is now available
Previous section-----Next section

4.2 Interpolation and Decimation

Replicate function.

In[1]:=
In[2]:=
Out[2]//MatrixForm=Out[2]//MatrixForm=

Interpolate, Decimate, and Resize functions.

Functions Interpolate and Decimate change the dimensions by integer factors. Interpolation of order 2 doubles the size of a 1D array and quadruples the size of an image. A new value is inserted between every pair of elements. Linear filtering is used to calculate the new value. Here is an example of using a simple two-point linear interpolator.
In[3]:=
Out[3]//MatrixForm=Out[3]//MatrixForm=
It is sometimes necessary to resize an array by a noninteger factor, for example by specifying some arbitrary desired dimensions. This may be conveniently accomplished with the function Resize. Resize uses the built-in function ListInterpolation (and accepts the same options) to return a result of any dimensions. Note that this operation may alter the aspect ratio of the image.
In[4]:=
Out[4]//MatrixForm=Out[4]//MatrixForm=
Downsampling and upsampling are basic sample rate conversion functions. Downsampling of image img by a factor k decreases the image dimensions by retaining every kth row and column of img. Upsampling of image img by a factor k is an operation of threading k rows and columns of zeros into img. Functions UpSample and DownSample operate on ImageData expressions and lists of any dimensions. Integer factor interpolation is implemented as an upsample operation followed by linear filtering, while decimation is a linear filtering followed by downsampling [Pro96].

DownSample and UpSample functions.

In[5]:=
Out[5]=Out[5]=
In[6]:=
Out[6]=Out[6]=
In[7]:=
In[8]:=
Out[8]=Out[8]=
In[9]:=
Out[9]=Out[9]=


Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.