{"id":37080454,"url":"https://github.com/echocatzh/conv-stft","last_synced_at":"2026-01-14T09:46:02.558Z","repository":{"id":62564742,"uuid":"288258367","full_name":"echocatzh/conv-stft","owner":"echocatzh","description":"A STFT/iSTFT written up in PyTorch using 1D Convolutions","archived":false,"fork":false,"pushed_at":"2024-07-09T17:55:12.000Z","size":193,"stargazers_count":32,"open_issues_count":1,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-06T18:12:52.534Z","etag":null,"topics":["conv-stft","padding","stft"],"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/echocatzh.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}},"created_at":"2020-08-17T18:38:08.000Z","updated_at":"2025-10-15T07:59:39.000Z","dependencies_parsed_at":"2022-11-03T16:00:49.363Z","dependency_job_id":null,"html_url":"https://github.com/echocatzh/conv-stft","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/echocatzh/conv-stft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echocatzh%2Fconv-stft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echocatzh%2Fconv-stft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echocatzh%2Fconv-stft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echocatzh%2Fconv-stft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/echocatzh","download_url":"https://codeload.github.com/echocatzh/conv-stft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echocatzh%2Fconv-stft/sbom","scorecard":{"id":365157,"data":{"date":"2025-08-11","repo":{"name":"github.com/echocatzh/conv-stft","commit":"88b90be033d18fe398ee957a3d33b69a0eafe36c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52","Warn: Project is vulnerable to: PYSEC-2019-156 / GHSA-xp76-357g-9wqq","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T11:41:40.955Z","repository_id":62564742,"created_at":"2025-08-18T11:41:40.955Z","updated_at":"2025-08-18T11:41:40.955Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28416120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["conv-stft","padding","stft"],"created_at":"2026-01-14T09:46:01.980Z","updated_at":"2026-01-14T09:46:02.551Z","avatar_url":"https://github.com/echocatzh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Conv-STFT/iSTFT in PyTorch\n\nNOTE!!!: This package will no longer be maintained, and the API calls in this repo are exactly the same in [torch-mfcc](https://github.com/echocatzh/torch-mfcc).\n```python\nfrom conv_stft import STFT # same as below\nfrom torch_mfcc import STFT\n```\n\nAuthor: Shimin Zhang\n\nThe code refers to the following repo:\n1. [remove modulation effects](https://github.com/pseeth/torch-stft) \n2. [enframe and conv-overlap-add](https://github.com/huyanxin/phasen/blob/master/model/conv_stft.py)\n\nAn STFT/iSTFT written up in PyTorch(py3) using 1D Convolutions. There are two window logic, `break` and `continue`.\n\n- `break` - a kaldi-like framing method\n\nWhen the parameters `win_len` and `fft_len` are different, padding `fft_len`-`win_len` zero points after each frame( len(frame) = `win_len` ), and the window ( len(window) = `win_len` ) always wise-multiply with frame before padding.\n\n- `continue` - a librosa-like framing method.\n\nWhen the parameters `win_len` and `fft_len` are different, framing the signal using `win_len`=`fft_len`, and zero padding on both sides of window ( len(window) = `win_len` ), which is `len(center_pad(window))=fft_len`\n\n## Installation\n\nInstall easily with pip:`pip install conv_stft` or download this repo, `python setup.py install`.\n\n## Usage\n\n```python3\nimport torch\nfrom conv_stft import STFT\nimport numpy as np\nimport librosa \nimport matplotlib.pyplot as plt\n\naudio = librosa.load(librosa.util.example_audio_file(), duration=10.0, offset=30)[0]\ndevice = 'cpu'\nfft_len = 1024\nwin_hop = 256\nwin_len = 1024\nwindow = 'hann'\n\naudio = torch.FloatTensor(audio)\naudio = audio.unsqueeze(0)\naudio = audio.to(device)\n\nstft = STFT(\n    fft_len=fft_len, \n    win_hop=win_hop, \n    win_len=win_len,\n    win_type=window,\n).to(device)\n\nmagnitude, phase = stft.transform(audio, return_type='magphase') # 'magphase' or 'realimag'\noutput = stft.inverse(magnitude, phase, input_type='magphase') # 'magphase' or 'realimag'\noutput = output.cpu().data.numpy()[..., :]\naudio = audio.cpu().data.numpy()[..., :]\nprint(np.mean((output - audio) ** 2)) # on order of 1e-15\n```\n\nOutput of [`compare_stft.py`](compare_stft.py):\n\n![images/stft.png](images/stft.png)\n\n## Tests\nTest it by just cloning this repo and running\n    \n```\npip install -r requirements.txt\npython -m pytest .\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechocatzh%2Fconv-stft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fechocatzh%2Fconv-stft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechocatzh%2Fconv-stft/lists"}