torch-mdct


Nametorch-mdct JSON
Version 0.4.1 PyPI version JSON
download
home_pageNone
SummaryA PyTorch implementation of the Modified Discrete Cosine Transform (MDCT) and its inverse for audio processing.
upload_time2024-12-17 10:40:54
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

A PyTorch implementation of the Modified Discrete Cosine Transform (MDCT) and its inverse for audio processing.

## Installation 

```bash
pip install torch_mdct
```

## Usage

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

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

# Initialize the mdct and imdct transforms
mdct = MDCT(win_length=1024, window_fn=vorbis, window_kwargs=None, center=True)
imdct = IMDCT(win_length=1024, window_fn=vorbis, window_kwargs=None, center=True)

# 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/e9/6d/a65d5e09b791833493cf3b3b017d29b00f567f880a704fd518585c9f8c4c/torch_mdct-0.4.1.tar.gz",
    "platform": null,
    "description": "# torch_mdct\n\nA PyTorch implementation of the Modified Discrete Cosine Transform (MDCT) and its inverse for audio processing.\n\n## Installation \n\n```bash\npip install torch_mdct\n```\n\n## Usage\n\n```python\nimport torchaudio\nfrom torch_mdct import IMDCT, MDCT, kaiser_bessel_derived, vorbis\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=1024, window_fn=vorbis, window_kwargs=None, center=True)\nimdct = IMDCT(win_length=1024, window_fn=vorbis, window_kwargs=None, center=True)\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.4.1",
    "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": "28cd28f348cfb3590946b5929acbfc80669da49050a8871b91c2206386c98928",
                "md5": "5a040c02b1e185e91c5bcdd9f7e3fd99",
                "sha256": "67a3863260ba7115e55e15e6cef02d19c343d3f0ecd32f8a16e8626663078c5d"
            },
            "downloads": -1,
            "filename": "torch_mdct-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5a040c02b1e185e91c5bcdd9f7e3fd99",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6239,
            "upload_time": "2024-12-17T10:40:49",
            "upload_time_iso_8601": "2024-12-17T10:40:49.343521Z",
            "url": "https://files.pythonhosted.org/packages/28/cd/28f348cfb3590946b5929acbfc80669da49050a8871b91c2206386c98928/torch_mdct-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e96da65d5e09b791833493cf3b3b017d29b00f567f880a704fd518585c9f8c4c",
                "md5": "ae88a53e8cb3f8e5e33bdfcd620edd2c",
                "sha256": "61282b3679b07a8a4671601d9251d9a74e2cf1a24eab4fd51eae707d9d6c6137"
            },
            "downloads": -1,
            "filename": "torch_mdct-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ae88a53e8cb3f8e5e33bdfcd620edd2c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3025737,
            "upload_time": "2024-12-17T10:40:54",
            "upload_time_iso_8601": "2024-12-17T10:40:54.289618Z",
            "url": "https://files.pythonhosted.org/packages/e9/6d/a65d5e09b791833493cf3b3b017d29b00f567f880a704fd518585c9f8c4c/torch_mdct-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-17 10:40:54",
    "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.40934s