Skip to main content

Python Wrapper for PESQ Score (narrow band and wide band)

Project description

python-pesq

PESQ (Perceptual Evaluation of Speech Quality) Wrapper for Python Users

This code is designed for numpy array specially.

Requirements

gcc compiler
numpy
cython

Build and Install

$ git clone https://github.com/ludlows/python-pesq.git
$ cd python-pesq
$ pip install .  # for python 2
$ pip3 install . # for python 3 
$ cd ..
$ rm -rf python-pesq # remove the code folder since it exists in the python package folder

Install with pip

$ pip install https://github.com/ludlows/python-pesq/archive/master.zip

# or

$ pip3 install https://github.com/ludlows/python-pesq/archive/master.zip

Example for narrow band and wide band

when using it, please note that the sampling rate (frequency) should be 16000 or 8000.

And using 8000 is supported for narrow band only.

from scipy.io import wavfile
from pesq import pesq

rate, ref = wavfile.read("./audio/speech.wav")
rate, deg = wavfile.read("./audio/speech_bab_0dB.wav")

print(pesq(rate, ref, deg, 'wb'))
print(pesq(rate, ref, deg, 'nb'))

Correctness

The correctness is verified by running samples in audio folder.

PESQ computed by this code in wide band mode is 1.0832337141036987

PESQ computed by this code in narrow band mode is 1.6072081327438354

Note

Sampling rate (fs|rate) - No default. Must select either 8000Hz or 16000Hz.

Note there is narrow band (nb) mode only when sampling rate is 8000Hz.

The original C soure code is modified.

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

pesq-0.0.1.tar.gz (80.0 kB view details)

Uploaded Source

File details

Details for the file pesq-0.0.1.tar.gz.

File metadata

  • Download URL: pesq-0.0.1.tar.gz
  • Upload date:
  • Size: 80.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for pesq-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5116d36bb809426a74a441740d25eba0a5083319e5a955b7921d62341c62a321
MD5 450250a2c373777236fc0fd7dfa0fc71
BLAKE2b-256 8cdc5b57e69fbe45b8d4c75295f5f8d907e166e613df1a42556e6ecbb6d8cfd9

See more details on using hashes here.

Supported by

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