-
Notifications
You must be signed in to change notification settings - Fork 79
/
__init__.py
52 lines (31 loc) · 1.14 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# coding: utf-8
"""
A python wrapper for `Speech Signal Processing Toolkit (SPTK)
<http://sp-tk.sourceforge.net>`_.
https://github.com/r9y9/pysptk
Full documentation
------------------
A full documentation of SPTK is available at http://sp-tk.sourceforge.net.
The wrapper is based on a modified version of SPTK (`r9y9/SPTK
<https://github.com/r9y9/SPTK>`_)
"""
from __future__ import division, print_function, absolute_import
import pkg_resources
__version__ = pkg_resources.get_distribution('pysptk').version
def assert_gamma(gamma):
if not (-1 <= gamma <= 0.0):
raise ValueError("unsupported gamma: must be -1 <= gamma <= 0")
def assert_pade(pade):
if pade != 4 and pade != 5:
raise ValueError("4 or 5 pade approximation is supported")
def assert_stage(stage):
if stage < 1:
raise ValueError("stage >= 1 (-1 <= gamma < 0)")
def ispow2(num):
return ((num & (num - 1)) == 0) and num != 0
def assert_fftlen(fftlen):
if not ispow2(fftlen):
raise ValueError("fftlen must be power of 2")
from .sptk import * # pylint: disable=wildcard-import
from . import synthesis
from .conversion import mgc2b