klyn.math.NDArray.correlate
method
public correlate(notnull other as NDArray<T>, mode as CorrelationMode = CorrelationMode.Valid) as NDArray<Double>
Description

Direct discrete cross-correlation c[k] = sum(x[i+k] * other[i]). Both arguments must be 1D; inputs are unchanged, no FFT is hidden. Cost is O(N*M), with O(output length) storage and compensated sums.

Parameters
ParameterDescription
otherSecond numeric series, same element type.
modeValid, Same or Full; default Valid, in increasing lag order.
Returns

Double series containing the selected correlation lags.

Throws
  • ValueException for null/non-1D input, null mode or size overflow.
  • NullException if other is null at runtime; statically null arguments are rejected with TypeError.
Example

result = signal.correlate(kernel, CorrelationMode.Full)