Array Expand Compress

Changes the size of an array by compress or expand its elements. Provides a linear interpolation.

For example, with a 512 array length in input and Factor=0.5 we obtain a 0.5*512=256 array length output.

Can be used to expand or compress the spectra of a sound.

input array

expand with factor=2

expand with factor=0.5



Bypasses the module.

array in

Array input flow(s).

array out

Array output flow(s).


Compress expand factor:

  • if factor < 1, provides a compression.
  • if factor > 1, provides an expansion.
  • if factor = 1, no changes.


Interpolation mode to calculate the new array.

  • linear interpolation between values
  • accumulation
     newIndex = trunc(factor*oldIndex);
     output[newIndex] := output[newIndex]+input[oldIndex]
  • no interpolation, nearest mapping
     inIndex = trunc(outIndex/factor);
     output[outIndex] := input[inIndex]

    no interpolation mode can be used for array's of color values.

See also

version 5.2.221206

Edit All Pages