---
title: "resample"
sidebar_label: "resample"
description: "Kotlin binding reference: resample."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[resample](resample.md)

# resample

[common]\
fun [resample](resample.md)(input: [Tensor](../Tensor/index.md), origFreq: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), newFreq: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), lowpassFilterWidth: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 16, rolloff: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.945, beta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)

`resample(input: Tensor, origFreq: Long, newFreq: Long, lowpassFilterWidth: Long = 16L, rolloff: Double = 0.945, beta: Double? = null)`: the `resample` operator. Audio-domain 1-D rational resample along the LAST axis: `[.., S]` at `orig_freq` → `[.., ceil(S · L / M)]` at `new_freq`, where `L/M` is the gcd-reduced rate pair. A kaiser-windowed-sinc polyphase FIR, the standard antialiased sample-rate converter; input outside the signal reads as zero, and equal rates pass the signal through exactly. Leading axes are batch/channels (transpose another samples axis to the back first, a view). The defaults are the kaiser preset: `lowpass_filter_width` sinc zero-crossings per side, `rolloff` of the target Nyquist, and (when `beta` is absent) the design beta 14.769656459379492 (~142.7 dB design stopband). Serves f32 natively and f16/bf16 through an f32 compute lane (output mirrors the input); integer and f64 signals refuse; cast to f32 first. CPU-served; device-resident inputs refuse until an accelerator kernel lands.