{"id":15674652,"url":"https://github.com/yoyolicoris/kazane","last_synced_at":"2025-12-14T02:02:41.709Z","repository":{"id":62573845,"uuid":"376521665","full_name":"yoyolicoris/kazane","owner":"yoyolicoris","description":"Simple sinc interpolation in PyTorch.","archived":false,"fork":false,"pushed_at":"2023-07-08T15:59:06.000Z","size":48,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-04T16:58:31.028Z","etag":null,"topics":["downsampling","dsp","pytorch-implementation","upsample"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yoyolicoris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-13T11:17:23.000Z","updated_at":"2024-07-22T03:39:56.000Z","dependencies_parsed_at":"2024-10-23T12:09:13.574Z","dependency_job_id":null,"html_url":"https://github.com/yoyolicoris/kazane","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":"0.48275862068965514","last_synced_commit":"a7af6767ad3cfddce12cbfd35d0812e64c0394f2"},"previous_names":["yoyolicoris/kazane","yoyololicon/kazane"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyolicoris%2Fkazane","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyolicoris%2Fkazane/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyolicoris%2Fkazane/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyolicoris%2Fkazane/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoyolicoris","download_url":"https://codeload.github.com/yoyolicoris/kazane/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252784363,"owners_count":21803663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["downsampling","dsp","pytorch-implementation","upsample"],"created_at":"2024-10-03T15:48:48.246Z","updated_at":"2025-12-14T02:02:36.431Z","avatar_url":"https://github.com/yoyolicoris.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kazane: simple sinc interpolation for 1D signal in PyTorch\n\n\n[![build](https://github.com/yoyololicon/kazane/actions/workflows/python-package.yml/badge.svg)](https://github.com/yoyololicon/kazane/actions/workflows/python-package.yml)\n[![Upload Python Package](https://github.com/yoyololicon/kazane/actions/workflows/python-publish.yml/badge.svg)](https://github.com/yoyololicon/kazane/actions/workflows/python-publish.yml)\n[![PyPI version](https://badge.fury.io/py/kazane.svg)](https://badge.fury.io/py/kazane)\n\nKazane 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](https://github.com/adefossez/julius).\n\n## Installation\n\n```commandline\npip install kazane\n```\nor \n``` commandline\npip install git+https://github.com/yoyololicon/kazane\n```\nfor latest version.\n\n## Usage\n\n```python\nimport kazane\nimport torch\n\nsignal = torch.randn(8, 2, 44100)\n\n# downsample by an amount of 3\ndecimater = kazane.Decimate(3)\nresampled_signal = decimater(signal)\n\n# upsample by an amount of 2\nupsampler = kazane.Upsample(2)\nresampled_signal = upsampler(signal)\n\n# you can also control number of zeros, roll-off frequency of the sinc interpolation kernel\ndecimater = kazane.Decimate(3, num_zeros=24, roll_off=0.9)\n\n# use other types of window function for the sinc kernel\nupsampler = kazane.Upsample(2, window_func=torch.blackman_window)\n```\n\n## Benchmarks on CUDA\nUsing the benchmark scripts at [bench](./bench), you can see that FFT can gives some speed improvements when the sample rate changes with some common integer numbers.\n```\n[---------- Down sample ----------]\n               |  julius  |  kazane\n2 threads: ------------------------\n      rate: 2  |   52.2   |   52.4 \n      rate: 3  |   66.5   |   36.1 \n      rate: 5  |   94.8   |   30.0 \n      rate: 7  |  121.7   |   42.3 \n\nTimes are in milliseconds (ms).\n\n[----------- Up sample -----------]\n               |  julius  |  kazane\n2 threads: ------------------------\n      rate: 2  |   48.8   |   39.0 \n      rate: 3  |   68.1   |   51.6 \n      rate: 5  |  112.5   |   78.9 \n      rate: 7  |  159.4   |  108.0 \n\nTimes are in milliseconds (ms).\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoyolicoris%2Fkazane","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoyolicoris%2Fkazane","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoyolicoris%2Fkazane/lists"}