CLI and library to compute the Mel-Cepstral Distance of two WAV files based on the paper 'Mel-Cepstral Distance Measure for Objective Speech Quality Assessment' by Robert F. Kubichek.
Project description
Mel-Cepstral Distance
CLI and library to compute the mel-cepstral distance of two WAV files based on the paper "Mel-Cepstral Distance Measure for Objective Speech Quality Assessment" by Robert F. Kubichek.
Installation
pip install mel-cepstral-distance --user
Usage as CLI
mcd-cli
Example
# Download two example audio files
wget https://github.com/jasminsternkopf/mel_cepstral_distance/raw/main/examples/similar_audios/original.wav
wget https://github.com/jasminsternkopf/mel_cepstral_distance/raw/main/examples/similar_audios/inferred.wav
# Calculate metrics
mcd-cli original.wav inferred.wav
Output:
Mel-Cepstral Distance: 19.013673608495836
Penalty: 0.11946050096339111
# Frames: 519
This will print a message informing you about the mel-cepstral distance and penalty between the audios whose paths were given as arguments and the number of frames that were used in the computation.
Usage as a library
from mel_cepstral_distance import get_metrics_wavs, get_metrics_mels
Methods
get_metrics_wavs
get_metrics_mels
Both methods return the mel-cepstral distance, the penalty and the final frame number. Examples and information on the parameters can be found in the corresponding documentations.
Dependencies
librosa >= 0.9.1, < 0.1
numpy >= 1.22.3, < 1.24
scipy >= 1.8.0, < 1.10
fastdtw >= 0.3.4, < 0.4
Roadmap
- add command to process audio files from two distinct directories and output the result into a csv file
Contributing
If you notice an error, please don't hesitate to open an issue.
License
MIT License
Acknowledgments
Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project-ID 416228727 – CRC 1410
Citation
If you want to cite this repo, you can use this BibTeX-entry:
@misc{stmcd22,
author = {Sternkopf, Jasmin and Taubert, Stefan},
title = {mel-cepstral-distance},
year = {2022},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/jasminsternkopf/mel_cepstral_distance}}
}
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
Hashes for mel-cepstral-distance-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02eb274929f77eb655a096083728f818985fd2b99c8260bb83c98cd68d73b7e7 |
|
MD5 | a25557efc03de72429b16e0e32d954d1 |
|
BLAKE2b-256 | 41bdc9763ec6e50649b76cc15a5f4879e03fecc5f3ad22aee2ec5b7e7d1d63f1 |
Hashes for mel_cepstral_distance-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0c122b6ed203d692dc26cf2263ef318eef81707564a3524a898cb1b03320303 |
|
MD5 | fdeaece1038a6795f50e33c4222342b9 |
|
BLAKE2b-256 | 9435fd0bfae26d1bdfdd570a5933ee4592a002594a4759b0b295c3fe4d742df7 |