forked from aliutkus/speechmetrics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request aliutkus#24 from turian/pesq
Wide-band PESQ
- Loading branch information
Showing
5 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from . import bsseval | ||
from . import pesq | ||
from . import stoi | ||
from . import nb_pesq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from .. import Metric | ||
|
||
|
||
class NBPESQ(Metric): | ||
def __init__(self, window, hop=None): | ||
super(NBPESQ, self).__init__(name='NBPESQ', window=window, hop=hop) | ||
self.mono = True | ||
self.fixed_rate = 16000 | ||
|
||
def test_window(self, audios, rate): | ||
from pypesq import pesq | ||
if len(audios) != 2: | ||
raise ValueError('NB_PESQ needs a reference and a test signals.') | ||
return {'nb_pesq': pesq(audios[1], audios[0], rate)} | ||
|
||
|
||
def load(window, hop=None): | ||
return NBPESQ(window, hop) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters