Upsample
✖
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.
Upsample[image,…]
upsamples an image.
Details

- In Upsample[array,…], array can be an array of any rank.
- Upsample works with arrays of any rank and 2D and 3D images.
- Upsample[array,{n1,n2,…}] inserts ni zeros between elements in the i
dimension.
- Upsample[array,n] is equivalent to Upsample[array,n,1].
- In Upsample[array,n,offset], the offset has to be an integer between 1 and n.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Upsample a list by a factor of 3:

https://wolfram.com/xid/0h2re4c6ey-mwupo5


https://wolfram.com/xid/0h2re4c6ey-vlhdtg

Specify the value to be inserted:

https://wolfram.com/xid/0h2re4c6ey-dxqdjn


https://wolfram.com/xid/0h2re4c6ey-ipuo5m

Upsample an image by a factor of 2:

https://wolfram.com/xid/0h2re4c6ey-zia02h

Scope (3)Survey of the scope of standard use cases
Use a different upsampling factor in each dimension:

https://wolfram.com/xid/0h2re4c6ey-qtomuu


https://wolfram.com/xid/0h2re4c6ey-els2ut

Upsample an image by a factor of 2:

https://wolfram.com/xid/0h2re4c6ey-0ged7c

By default, using offset equal to 1, no shifting is performed:

https://wolfram.com/xid/0h2re4c6ey-fypcq9


https://wolfram.com/xid/0h2re4c6ey-lzhw3s

Use a different offset in each dimension:

https://wolfram.com/xid/0h2re4c6ey-fzt4dj


https://wolfram.com/xid/0h2re4c6ey-gsu80j

Applications (3)Sample problems that can be solved with this function
Create a Nyquist filter of length 7:

https://wolfram.com/xid/0h2re4c6ey-cxpvus

Upsample by a factor of 2 using the smoothing filter:

https://wolfram.com/xid/0h2re4c6ey-4a89no


https://wolfram.com/xid/0h2re4c6ey-oxbmfd


https://wolfram.com/xid/0h2re4c6ey-ue3mc

Linear interpolation using upsampling and convolution:

https://wolfram.com/xid/0h2re4c6ey-47uvql

https://wolfram.com/xid/0h2re4c6ey-msz9qb

This implementation is not very efficient:

https://wolfram.com/xid/0h2re4c6ey-gop2is

A faster implementation would merge convolutions of the signal with odd and even samples of the filter:

https://wolfram.com/xid/0h2re4c6ey-q8l3kk


https://wolfram.com/xid/0h2re4c6ey-tpffne

Linear interpolation by a factor :

https://wolfram.com/xid/0h2re4c6ey-2yrdzx

https://wolfram.com/xid/0h2re4c6ey-ptf48

https://wolfram.com/xid/0h2re4c6ey-8v50ae

Wolfram Research (2012), Upsample, Wolfram Language function, https://reference.wolfram.com/language/ref/Upsample.html (updated 2016).
Text
Wolfram Research (2012), Upsample, Wolfram Language function, https://reference.wolfram.com/language/ref/Upsample.html (updated 2016).
Wolfram Research (2012), Upsample, Wolfram Language function, https://reference.wolfram.com/language/ref/Upsample.html (updated 2016).
CMS
Wolfram Language. 2012. "Upsample." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/Upsample.html.
Wolfram Language. 2012. "Upsample." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/Upsample.html.
APA
Wolfram Language. (2012). Upsample. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Upsample.html
Wolfram Language. (2012). Upsample. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Upsample.html
BibTeX
@misc{reference.wolfram_2025_upsample, author="Wolfram Research", title="{Upsample}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/Upsample.html}", note=[Accessed: 13-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_upsample, organization={Wolfram Research}, title={Upsample}, year={2016}, url={https://reference.wolfram.com/language/ref/Upsample.html}, note=[Accessed: 13-May-2025
]}