torch-mdct


Nametorch-mdct JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryA PyTorch implementation of the Modified Discrete Cosine Transform (MDCT) and its inverse for audio processing.
upload_time2024-11-07 13:27:02
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords audio imdct mdct pytorch signal processing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # torch_mdct

PyTorch implementation of Modified Discrete Cosine Transform and Inverse Modified Discrete Cosine Transform.

## Installation 

```bash
pip install torch_mdct
```

## Usage

```python
import torchaudio
from torch_mdct import MDCT, IMDCT

# Load a sample waveform 
waveform, sample_rate = torchaudio.load("/path/to/audio.file")

# Initialize the mdct and imdct transforms
mdct = MDCT(win_length=2048)
imdct = IMDCT(win_length=2048)

# Transform waveform into mdct spectrogram
spectrogram = mdct(waveform)

# Transform spectrogram back to audio 
reconst_waveform = imdct(spectrogram)

# Compute the differences
print(f"L1: {(waveform - reconst_waveform).abs().mean()}")
```

## References 
[[1]](https://github.com/zafarrafii/Zaf-Python) Zaf-Python: Zafar's Audio Functions in **Python** for audio signal analysis.

[[2]](https://github.com/nils-werner/mdct) MDCT: A fast MDCT implementation using SciPy and FFTs.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "torch-mdct",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "audio, imdct, mdct, pytorch, signal processing",
    "author": null,
    "author_email": "Kinyugo Maina <kinyugomaina@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/8f/b0/eaa9a7b48f5ffc1dac51d06e14e27fb3382ea891e24f39667ca3286182d3/torch_mdct-0.1.0.tar.gz",
    "platform": null,
    "description": "# torch_mdct\n\nPyTorch implementation of Modified Discrete Cosine Transform and Inverse Modified Discrete Cosine Transform.\n\n## Installation \n\n```bash\npip install torch_mdct\n```\n\n## Usage\n\n```python\nimport torchaudio\nfrom torch_mdct import MDCT, IMDCT\n\n# Load a sample waveform \nwaveform, sample_rate = torchaudio.load(\"/path/to/audio.file\")\n\n# Initialize the mdct and imdct transforms\nmdct = MDCT(win_length=2048)\nimdct = IMDCT(win_length=2048)\n\n# Transform waveform into mdct spectrogram\nspectrogram = mdct(waveform)\n\n# Transform spectrogram back to audio \nreconst_waveform = imdct(spectrogram)\n\n# Compute the differences\nprint(f\"L1: {(waveform - reconst_waveform).abs().mean()}\")\n```\n\n## References \n[[1]](https://github.com/zafarrafii/Zaf-Python) Zaf-Python: Zafar's Audio Functions in **Python** for audio signal analysis.\n\n[[2]](https://github.com/nils-werner/mdct) MDCT: A fast MDCT implementation using SciPy and FFTs.",
    "bugtrack_url": null,
    "license": null,
    "summary": "A PyTorch implementation of the Modified Discrete Cosine Transform (MDCT) and its inverse for audio processing.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/Kinyugo/torch_mdct",
        "Issues": "https://github.com/Kinyugo/torch_mdct/issues"
    },
    "split_keywords": [
        "audio",
        " imdct",
        " mdct",
        " pytorch",
        " signal processing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cb4c0645cfdcae6fa39cb9ebe97c7bcc309585ac330da9f7e282e08850dfd65c",
                "md5": "2d04455ad5ec3836fc75e39a78d53fa2",
                "sha256": "7933f1265bc95bd595d4fc2e606a5c89ab49a2874b74359294b9764f49accca1"
            },
            "downloads": -1,
            "filename": "torch_mdct-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2d04455ad5ec3836fc75e39a78d53fa2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5713,
            "upload_time": "2024-11-07T13:26:53",
            "upload_time_iso_8601": "2024-11-07T13:26:53.021412Z",
            "url": "https://files.pythonhosted.org/packages/cb/4c/0645cfdcae6fa39cb9ebe97c7bcc309585ac330da9f7e282e08850dfd65c/torch_mdct-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8fb0eaa9a7b48f5ffc1dac51d06e14e27fb3382ea891e24f39667ca3286182d3",
                "md5": "c90a7fb748a2e8ce5e8f5d124b5f25d5",
                "sha256": "0f3b454bfb7a8ee4954e8d5c045d5906340799c349846b8b03fcb6d2abcdacb3"
            },
            "downloads": -1,
            "filename": "torch_mdct-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c90a7fb748a2e8ce5e8f5d124b5f25d5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3024466,
            "upload_time": "2024-11-07T13:27:02",
            "upload_time_iso_8601": "2024-11-07T13:27:02.537226Z",
            "url": "https://files.pythonhosted.org/packages/8f/b0/eaa9a7b48f5ffc1dac51d06e14e27fb3382ea891e24f39667ca3286182d3/torch_mdct-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-07 13:27:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Kinyugo",
    "github_project": "torch_mdct",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "torch-mdct"
}
        
Elapsed time: 0.77724s