pesq is a Python wrapper for the Perceptual Evaluation of Speech Quality (PESQ) metric, implementing the ITU-T P.862 standard. It supports both narrow-band ('nb') and wide-band ('wb') calculations, providing an objective measure of speech quality. The current version is 0.0.4, with releases occurring infrequently but introducing new features like multiprocessing support.
pip install pesqVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to calculate a PESQ score using NumPy arrays for reference and degraded audio signals. It highlights the use of the `pesq` function with a specified sampling rate and mode ('wb' for wide-band). The library internally handles the necessary conversions, but input characteristics are crucial.
Ensure a C compiler and associated build tools are installed on your system before attempting `pip install pesq`.
Pre-process your audio signals to ensure they are consistent: resample to a common rate (e.g., 16 kHz), convert to 16-bit PCM representation (if not already), and trim/pad to equal lengths.
Always verify that the `mode` argument ('nb' or 'wb') passed to `pesq` or `pesq_batch` is appropriate for your audio data and the desired evaluation.Upgrade to v0.0.3 or higher to benefit from improved error messages and more graceful error handling.