---
title: "ClikaRT::ops::resample"
sidebar_label: "resample"
description: "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."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

## resample() {#resample}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`resample`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `input`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::int64_t` `orig_freq`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::int64_t` `new_freq`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::int64_t` `lowpass_filter_width` `=` `16`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`double` `rolloff` `=` `0.945`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::optional<double>` `beta` `=` `std::nullopt`<br />
)

</div>

Audio-domain 1-D rational resample along the LAST axis: `[.., S]` at `orig_freq` → `[.., `[`ceil`](./ceil.md#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.

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 3324

</div>
