Upsample

Upsample[array, n]
returns an upsampled version of the array by inserting zeros between array elements.

Upsample[array, n, offset]
shifts array so that its first element moves to the position offset in the resulting array.

Upsample[array, n, offset, val]
inserts elements of value val between array elements.

DetailsDetails

  • In Upsample[array, n, offset], the offset has to be a number between and n.
  • In Upsample[array, ...], array can be an array of any rank.
  • Upsample[array, {n1, n2, ...}] inserts zeros between elements in the i^(th) dimension.
  • Upsample[array, n] is equivalent to Upsample[array, n, 1].

ExamplesExamplesopen allclose all

Basic Examples (4)Basic Examples (4)

Upsample a list by a factor of 3:

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

Use an offset:

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

Specify the value to be inserted:

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

Upsample a 2D array:

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

Use a different upsampling factor in each dimension:

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

Upsample a symbolic array:

In[1]:=
Click for copyable input
Out[1]=
New in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »