LPC Utility for Pytorch Library.
LPC Torch
LPCTorch is a small pytorch utility for Linear Predictive Coding. It provides a simple way to compute windowed Linear Predictive Coding Coefficients on a input audio signal. The repo uses the Burg's methods [1] and is heavily inspired from the librosa audio library implementation [2].
Install
Install the module using the pip utility ( may require to run as sudo )
pip3 install lpctorch
Usage
LPC Coefficients
from lpctorch import LPCCoefficients
# Parameters
# * sr : sample rate of the signal ( 16 kHz )
# * frame_duration: duration of the window in seconds ( 16 ms )
# * frame_overlap : frame overlapping factor
# * K : number of linear predictive coding coefficients
sr = 16000
frame_duration = .016
frame_overlap = .5
K = 32
# Initialize the module given all the parameters
lpc_prep = LPCCoefficients(
sr,
frame_duration,
frame_overlap,
order = ( K - 1 )
)
# Get the coefficients given a signal
# torch.Tensor of size ( Batch, Samples )
alphas = lpc_prep( X )
Example
The repository provides an example application with a 'sample.wav' file. The output is the same as the one provided by librosa (bottom).
Benchmarks
Here are some benchmarks comparing cpu vs gpu inference times in seconds of the utility from 1 to 32 batch size.
References
Metadata
Release files for LPCTorch 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| LPCTorch-0.1.4.tar.gz | 4.3 kB | Without provenance | Details for LPCTorch-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| LPCTorch-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for LPCTorch-0.1.4-py3-none-any.whl |
Total release size: 8.9 kB
Release files / LPCTorch-0.1.4.tar.gz
| Download URL | LPCTorch-0.1.4.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41d66a154d95431b670bf166e48eda50aa7b332ee643e02ca50bd12887a9049f
|
|
BLAKE2b-256 checksum How to use checksums |
8514b4b6c8ed3eae47a9c26fb3b6380d74f8d163eecb89edde20890bf41818d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
|
Release files / LPCTorch-0.1.4-py3-none-any.whl
| Download URL | LPCTorch-0.1.4-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed9f858e5fb2f9a1ac170adf3cf410c25f1a7634c63e2bf927ba40e28f87782f
|
|
BLAKE2b-256 checksum How to use checksums |
4fa896eebd6f7a54d53315eccafafa26f06c44cb67df7be32d73fa26a8b3bb82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
|
Security for LPCTorch 0.1.4
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.