ArrayResample

ArrayResample[array,{n1,n2,}]

resamples array to have dimensions {n1,n2,}.

ArrayResample[array,dspec]

resamples array according to the dimension specification dspec.

ArrayResample[array,dspec,scheme]

specifies resampling scheme, either point or bin based.

ArrayResample[array,dspec,scheme,{{xmin,xmax},}]

resamples only the data in the specified subrange {{xmin,xmax},}.

Details and Options

  • ArrayResample can be used for resampling data arrays based on a large selection of interpolation and approximation models.
  • ArrayResample works with data arrays of any depth.
  • The dimension specification dspec can be of the form:
  • nn samples
    Scaled[s]rescale sampling resolution by factor s
    Allpreserve dimension
    Automaticpreserve dimension ratios
    {dspec1,,dspeck}resample up to the ^(th) dimension
  • For a multidimensional array, the notation n is taken to be equivalent to {n,Automatic,} and {n} equivalent to {n,All,}.
  • The dimension ratios for an array of dimensions is taken to be .
  • The scheme determines the location of sample and resample positions and can be of the form:
  • "Point"point sampling (default)
    "Bin"bin sampling
    {"Bin",alignment}bin sampling with specified alignment
  • For input data of length n the "Point" resampling scheme assumes a data range from 1 to n and the "Bin" scheme assumes a data range from 0 to n with the alignment indicating the sample location within each bin.
  • Bin alignment alignment can be Left, Center, Right or any number between (Left) and 1 (Right).
  • The data range can be modified using the DataRange option.
  • By default, the data is resampled on the entire data domain, ranging from 1 to for the "Point" scheme and from 0 to for the "Bin" scheme. Use the DataRange option to modify the coordinates of the data domain.
  • With a subrange {{xmin,xmax},} specified with respect to the DataRange, only the data values in the given interval are resampled.  »
  • The following options can be given:
  • AntialiasingFalseapply antialiasing when downsampling
    DataRangeAutomaticrange of the input data
    Padding"Fixed"padding method
    ResamplingAutomaticresampling method
  • For possible settings for Padding, see the reference page for ArrayPad.

Examples

open allclose all

Basic Examples  (2)

Subsample an array:

In[1]:=
Click for copyable input
Out[1]=

Downsample an array:

In[2]:=
Click for copyable input
Out[2]=

Resize a 2D array of data:

In[1]:=
Click for copyable input
Out[1]//MatrixForm=

Scope  (8)

Options  (5)

Applications  (1)

Properties & Relations  (2)

Possible Issues  (1)

See Also

ListInterpolation  Interpolation  ImageResize  Upsample  Downsample  Dimensions  ArrayPad  ArrayFilter

Tutorials

Introduced in 2014
(10.0)
| Updated in 2016
(11.0)