-
Notifications
You must be signed in to change notification settings - Fork 0
signal.Resampling.Function.resampleNearestNeighborRef
dsp-collection / signal/Resampling / resampleNearestNeighborRef
function resampleNearestNeighborRef(
ia,
oa,
preserveScale?,
extraValues?): void;Defined in: signal/Resampling.ts:101
Reference implementation of one-dimensional resampling using nearest-neighbor interpolation.
This a slow reference implementation. It is simpler to understand than the optimized implementation and produces the same result.
ArrayLike<number>
Input array.
MutableArrayLike<number>
output array.
boolean = false
false: inputPosition = (outputPosition + 0.5) / oa.length * ia.length - 0.5 The array is processed symetrically (except for the entries which are exactly in the middle between two neighbors). true: inputPosition = outputPosition / oa.length * ia.length.
number = 0
Value for the extra array entries at the end, when upsampling with preserveScale = true.
void