ClikaRT::ops::resample
function
resample()
Tensor resample(
Tensor x,
std::int64_t orig_freq,
std::int64_t new_freq,
std::int64_t lowpass_filter_width = 16,
double rolloff = 0.945,
std::optional<double> beta = std::nullopt
)
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.
Declared in ClikaRT/compute/ops.h, line 3237