Skip to main content

Calculate Mel-Cepstral Distortion (MCD)

Project description

Project description

This package (pymcd) computes Mel Cepstral Distortion (MCD) in python, which is used to assess the quality of the generated speech by comparing the discrepancy between generated and ground-truth speeches.

Overview

Mel Cepstral Distortion (MCD) is a measure of how different two sequences of mel cepstra are, which is widely used to evaluate the performance of speech synthesis models. The MCD metric compares k-th (default k=13) Mel Frequency Cepstral Coefficient (MFCC) vectors derived from the generated speech and ground truth, respectively.

The pymcd package provides scripts to compute a variety of forms of MCD score:

  • MCD (plain): the conventional MCD metric, which requires the lengths of two input speeches to be the same. Otherwise, it would simply extend the shorted speech to the length of longer one by padding zero for the time-domain waveform.
  • MCD-DTW: an improved MCD metric that adopts the Dynamic Time Warping (DTW) algorithm to find the minimum MCD between two speeches.
  • MCD-DTW-SL: MCD-DTW weighted by Speech Length (SL) evaluates both the length and the quality of alignment between two speeches. Based on the MCD-DTW metric, the MCD-DTW-SL incorporates an additional coefficient w.r.t. the difference between the lengths of two speeches.

More details of the above three types of MCD can be found in V2C: Visual Voice Cloning.

License

Please see the file License for details of the license and warranty for mcd.

Installation

Require Python 3, the package can be installed and updated using pip, i.e.,

pip install -U pymcd

Example

from pymcd.mcd import Calculate_MCD

# instance of MCD class
# three different modes "plain", "dtw" and "dtw_sl" for the above three MCD metrics
mcd_toolbox = Calculate_MCD(MCD_mode="plain")

# two inputs w.r.t. reference (ground-truth) and synthesized speeches, respectively
mcd_value = mcd_toolbox.calculate_mcd("001.wav", "002.wav")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymcd-0.2.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

pymcd-0.2.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file pymcd-0.2.1.tar.gz.

File metadata

  • Download URL: pymcd-0.2.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.2 tqdm/4.56.0 importlib-metadata/4.0.1 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.12

File hashes

Hashes for pymcd-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fe54081ef6c4e3ef4a3ebd6e5a93bd405d34d50865691a2843bcc9678071700e
MD5 e06b9874bb737f39eab0ea0215778740
BLAKE2b-256 b071459a4afcb2d748ca8f8d13bc08f3beeef68d8cc42eb7da7d2e487c571036

See more details on using hashes here.

File details

Details for the file pymcd-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pymcd-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.2 tqdm/4.56.0 importlib-metadata/4.0.1 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.12

File hashes

Hashes for pymcd-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 baf88a334acaf605d9dde43a56ba41f8760fc91a855448c76d51d2a4f14af6fa
MD5 8b3e97f1368c37415041970a8cf55d37
BLAKE2b-256 d04c81ae0227604d475a8bd92400150370e9eff0e1eadc730e4105d3f7955301

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page