All Projects → ludlows → Python Pesq

ludlows / Python Pesq

Licence: mit
PESQ (Perceptual Evaluation of Speech Quality) Wrapper for Python Users (narrow band and wide band)

Programming Languages

python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Python Pesq

SpleeterRT
Real time monaural source separation base on fully convolutional neural network operates on Time-frequency domain.
Stars: ✭ 111 (-22.92%)
Mutual labels:  signal-processing, audio-processing
RTspice
A real-time netlist based audio circuit plugin
Stars: ✭ 51 (-64.58%)
Mutual labels:  signal-processing, audio-processing
python-soxr
Fast and high quality sample-rate conversion library for Python
Stars: ✭ 25 (-82.64%)
Mutual labels:  signal-processing, audio-processing
Edsp
A cross-platform DSP library written in C++ 11/14. This library harnesses the power of C++ templates to implement a complete set of DSP algorithms.
Stars: ✭ 116 (-19.44%)
Mutual labels:  audio-processing, signal-processing
Surfboard
Novoic's audio feature extraction library
Stars: ✭ 318 (+120.83%)
Mutual labels:  audio-processing, signal-processing
DDCToolbox
Create and edit DDC headset correction files
Stars: ✭ 70 (-51.39%)
Mutual labels:  signal-processing, audio-processing
Python-Adaptive-Signal-Processing-Handbook
Python adaptive signal processing tutorials
Stars: ✭ 80 (-44.44%)
Mutual labels:  signal-processing, audio-processing
FluX
A convenient way of processing digital signals in F#
Stars: ✭ 17 (-88.19%)
Mutual labels:  signal-processing, audio-processing
Nara wpe
Different implementations of "Weighted Prediction Error" for speech dereverberation
Stars: ✭ 265 (+84.03%)
Mutual labels:  audio-processing, signal-processing
DTMF-Decoder
A Java program to implement a DMTF Decoder.
Stars: ✭ 28 (-80.56%)
Mutual labels:  signal-processing, audio-processing
Audio Reactive Led Strip
🎵 🌈 Real-time LED strip music visualization using Python and the ESP8266 or Raspberry Pi
Stars: ✭ 2,217 (+1439.58%)
Mutual labels:  audio-processing, signal-processing
Sincnet
SincNet is a neural architecture for efficiently processing raw audio samples.
Stars: ✭ 764 (+430.56%)
Mutual labels:  audio-processing, signal-processing
RS-MET
Codebase for RS-MET products (Robin Schmidt's Music Engineering Tools)
Stars: ✭ 32 (-77.78%)
Mutual labels:  signal-processing, audio-processing
Audio cat dog classification
Classification of WAV files from cats and dogs
Stars: ✭ 16 (-88.89%)
Mutual labels:  signal-processing, audio-processing
Klio
Smarter data pipelines for audio.
Stars: ✭ 560 (+288.89%)
Mutual labels:  audio-processing, signal-processing
Aca Code
Matlab scripts accompanying the book "An Introduction to Audio Content Analysis" (www.AudioContentAnalysis.org)
Stars: ✭ 67 (-53.47%)
Mutual labels:  audio-processing, signal-processing
Avdemo
Demo projects for iOS Audio & Video development.
Stars: ✭ 136 (-5.56%)
Mutual labels:  audio-processing
Bci.js
📊 EEG signal processing and machine learning in JavaScript
Stars: ✭ 117 (-18.75%)
Mutual labels:  signal-processing
Radio Transformer Networks
A PyTorch implementation of Radio Transformer Networks from the paper "An Introduction to Deep Learning for the Physical Layer".
Stars: ✭ 113 (-21.53%)
Mutual labels:  signal-processing
Proxtv
Matlab and Python toolbox for fast Total Variation proximity operators
Stars: ✭ 140 (-2.78%)
Mutual labels:  signal-processing

python-pesq

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

This code is designed for numpy array specially.

Requirements

C 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

# PyPi Repository
$ pip install pesq


# The Latest Version
$ 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.

Who is using python-pesq

Please click here to see these repositories, whose owners include Facebook Research, SpeechBrain, NVIDIA .etc.

Expressing your opinions on the error-handling behaviors

The code on dev branch supports error-handling behaviors now.

def pesq(fs, ref, deg, mode, on_error=PesqError.RAISE_EXCEPTION):
    """
    Args:
        ref: numpy 1D array, reference audio signal 
        deg: numpy 1D array, degraded audio signal
        fs:  integer, sampling rate
        mode: 'wb' (wide-band) or 'nb' (narrow-band)
        on_error: error-handling behavior, it could be PesqError.RETURN_VALUES or PesqError.RAISE_EXCEPTION by default
    Returns:
        pesq_score: float, P.862.2 Prediction (MOS-LQO)
    """

Once you select PesqError.RETURN_VALUES, the pesq function will return -1 when an error occurs.

Once you select PesqError.RAISE_EXCEPTION, the pesq function will raise an exception when an error occurs.

It supports the following errors now: InvalidSampleRateError, OutOfMemoryError,BufferTooShortError,NoUtterancesError,PesqError(other unknown errors).

Thanks to the contribution from @Rafgd.

Buy me a Coffee

Buy me a Coffee if my work helps you in some ways.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].