Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Kazane: simple sinc interpolation for 1D signal in PyTorch

build Release PyPI version

Kazane utilize FFT based convolution to provide fast sinc interpolation for 1D signal when your sample rate only needs to change by an integer amounts; If you need to change by a fraction amounts, checkout julius.

Installation

pip install kazane

or

pip install git+https://github.com/yoyolicoris/kazane

for latest version.

Usage

import kazane
import torch

signal = torch.randn(8, 2, 44100)

# downsample by an amount of 3
decimater = kazane.Decimate(3)
resampled_signal = decimater(signal)

# upsample by an amount of 2
upsampler = kazane.Upsample(2)
resampled_signal = upsampler(signal)

# you can also control number of zeros, roll-off frequency of the sinc interpolation kernel
decimater = kazane.Decimate(3, num_zeros=24, roll_off=0.9)

# use other types of window function for the sinc kernel
upsampler = kazane.Upsample(2, window_func=torch.blackman_window)

Benchmarks on CUDA

Using the benchmark scripts at bench, you can see that FFT can gives some speed improvements when the sample rate changes with some common integer numbers.

[---------- Down sample ----------]
               |  julius  |  kazane
2 threads: ------------------------
      rate: 2  |   52.2   |   52.4 
      rate: 3  |   66.5   |   36.1 
      rate: 5  |   94.8   |   30.0 
      rate: 7  |  121.7   |   42.3 

Times are in milliseconds (ms).

[----------- Up sample -----------]
               |  julius  |  kazane
2 threads: ------------------------
      rate: 2  |   48.8   |   39.0 
      rate: 3  |   68.1   |   51.6 
      rate: 5  |  112.5   |   78.9 
      rate: 7  |  159.4   |  108.0 

Times are in milliseconds (ms).

Metadata

Release files for kazane 2.0.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kazane 2.0.0rc1
File Size Uploaded Provenance Actions
kazane-2.0.0rc1.tar.gz 8.7 kB With provenance Details for kazane-2.0.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kazane 2.0.0rc1
File Interpreter ABI Platform Actions
kazane-2.0.0rc1-py3-none-any.whl Python 3 none any Details for kazane-2.0.0rc1-py3-none-any.whl

Total release size: 17.4 kB

Release files / kazane-2.0.0rc1.tar.gz

Download URL kazane-2.0.0rc1.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
455b48959e048a412538da81c246a41cadd3170c3c0502c5b0dc13bbe8ffb421
BLAKE2b-256 checksum
How to use checksums
2df16bb8e5703fb0000ec9a5e155aa734c2d1d246bfa8a7af6f3bf7aaef179f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / kazane-2.0.0rc1-py3-none-any.whl

Download URL kazane-2.0.0rc1-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
204cdf7e519c939c529cb8d85bb5604b29a3cbd07d7afe4f2e54887a912ede8c
BLAKE2b-256 checksum
How to use checksums
810364e72d58134513bcb613ea25c63ac0b98ca6847fd0b9fa616affd5d90217
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for kazane 2.0.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kazane-2.0.0rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page