This project contains a Python implementation of the MFCC features as computed by HTK.
Project description
PyHTK
HTK features in Python
This project contains a Python implementation of the MFCC features as computed by HTK.
What is HTK?
HTK is a respected toolkit used mainly by the speech community to perform research in speech recognition. Although quite old, many newer systems emulate the same feature extraction pipeline as used in HTK. Besides being thouroughly tested it is also well documented in a manual known as the HTK Book.
You can find more information about HTK on their official website: http://htk.eng.cam.ac.uk/
What is MFCC?
The MFCC feature set, as implemented in this little project, is one of the best performing techniques for modeling speech in tasks like speech recognition. While there may be others that are margianlly better in specific cases, MFCCs remain as a strong baseline for many standard benchmarks.
How to use?
Simply copy the HTKFeat.py file to your project and use the MFCC_HTK class from within. The class is throughly documented.
If you prefer, you can also install the file as a library:
pip install https://github.com/danijel3/PyHTK.git
Then you can access the class in your project using code like this:
# import the main class
from pyhtk.HTKFeat import MFCC_HTK
# these are additional libraries for this example
from pathlib import Path
import numpy as np
# contstruct the main mfcc object
# you can also change some arguments inside
mfcc = MFCC_HTK()
# load the raw audio file
sig = mfcc.load_raw_signal(Path("file.raw"))
# here we calculate the MFCC+energy, deltas and acceleration coefficients
feat = mfcc.get_feats(sig)
delta = mfcc.get_delta(feat, 2)
acc = mfcc.get_delta(delta, 2)
# merge the MFCCs and deltas together to get 39 features
feat = np.hstack((feat, delta, acc))
print(feat.shape)
How does it work?
Open the HTKFeaturesExplained notebook in the notebooks folder and play around with it. Everythin is explained there.
Also the the test.py script in the tests folder compares this library to the original HTK code so you can validate its accuracy.
Who made this?
If you have any questions, feel free to contact me at: danijel@pja.edu.pl
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyhtk-0.1.0.tar.gz.
File metadata
- Download URL: pyhtk-0.1.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b75a15d67de39ae323f5f8c69ac26480fabd366fe4d8dfc5434bc8c94e600e05
|
|
| MD5 |
daed6d393b116dfa98e78227b791ace7
|
|
| BLAKE2b-256 |
5bc6385551a85d6bb374be0393f60c3a5ce783912b20e9b9a4c4da4596b7f291
|
Provenance
The following attestation bundles were made for pyhtk-0.1.0.tar.gz:
Publisher:
python-publish.yml on danijel3/PyHTK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhtk-0.1.0.tar.gz -
Subject digest:
b75a15d67de39ae323f5f8c69ac26480fabd366fe4d8dfc5434bc8c94e600e05 - Sigstore transparency entry: 668504889
- Sigstore integration time:
-
Permalink:
danijel3/PyHTK@f55b09482feaba7b4822e28cce5c1a410e4b332c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/danijel3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f55b09482feaba7b4822e28cce5c1a410e4b332c -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyhtk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyhtk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33fa46118832e3a1d5a8a6ca49df8bed87a23357d91c6aa200931fdca9dd0b5f
|
|
| MD5 |
c2edf2759521893e1cced75f90418755
|
|
| BLAKE2b-256 |
67aa2b19255defb4b72f53fcb389d46f3748bfb8e50313f3880cb0819f180dbb
|
Provenance
The following attestation bundles were made for pyhtk-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on danijel3/PyHTK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhtk-0.1.0-py3-none-any.whl -
Subject digest:
33fa46118832e3a1d5a8a6ca49df8bed87a23357d91c6aa200931fdca9dd0b5f - Sigstore transparency entry: 668504940
- Sigstore integration time:
-
Permalink:
danijel3/PyHTK@f55b09482feaba7b4822e28cce5c1a410e4b332c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/danijel3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f55b09482feaba7b4822e28cce5c1a410e4b332c -
Trigger Event:
release
-
Statement type: