# Upsampling a non-power-of-two table to the next power-of-two number using cubic interpolation

**URL:** <https://forum.csound.com/t/upsampling-a-non-power-of-two-table-to-the-next-power-of-two-number-using-cubic-interpolation/2334>\
**Category:** Newbies\
**Created:** [November 24, 2025, 9:17pm UTC](https://forum.csound.com/t/upsampling-a-non-power-of-two-table-to-the-next-power-of-two-number-using-cubic-interpolation/2334 "2025-11-24T21:17:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Mont](https://forum.csound.com/user_avatar/forum.csound.com/ben_mont/32/717_2.png) [@Ben\_Mont](https://forum.csound.com/u/Ben_Mont)\
**Post date:** [November 24, 2025, 9:17pm UTC](https://forum.csound.com/t/upsampling-a-non-power-of-two-table-to-the-next-power-of-two-number-using-cubic-interpolation/2334/1 "2025-11-24T21:17:29Z")

</div>

Hello everyone,

I would like to rewrite a GEN 01 table (sound sample) into a GEN 02 table that would upsample the non-power-of-two isize of my GEN 01 table into a GEN 02 table whose isize is the next power-of-two number.

As an example, imagine that I have the following table with an isize = 5:  
index 0 = .2  
index 1 = -.12  
index 2 = .56  
index 3 = -.92  
index 5 = -.002

Which I wanted to rewrite in an table with an isize = 8

And that I wanted to use cubic interpolation. How would I go about it? My guess is that I would use table3 and tablew and using an irate loop, but I’m not sure as to how I would interpolate between the indexes.

Any ideas?

Thank you  
Ben
