Skip to content

signal.Resampling.Function.resampleLinear

Christian d'Heureuse edited this page Jun 7, 2026 · 2 revisions

dsp-collection / signal/Resampling / resampleLinear

Function: resampleLinear()

function resampleLinear(
   ia, 
   oa, 
   preserveScale?, 
   extraValues?): void;

Defined in: signal/Resampling.ts:144

Optimized one-dimensional resampling using linear interpolation.

This is normally used for fast upsampling.

Parameters

ia

ArrayLike<number>

Input array.

oa

MutableArrayLike<number>

output array.

preserveScale?

boolean = false

false: inputPosition = outputPosition / (oa.length - 1) * (ia.length - 1). The first input element matches the first output element and the last input element matches the last output element. The array is processed symetrically. true: inputPosition = outputPosition / oa.length * ia.length. The first input element matches the first output element, but the last input element does not match the last output element.

extraValues?

number = 0

Value for the extra array entries at the end, when upsampling with preserveScale = true.

Returns

void

Clone this wiki locally