-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
96 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. role:: hidden | ||
:class: hidden-section | ||
|
||
Features | ||
========= | ||
|
||
.. automodule:: speechpy.main | ||
.. currentmodule:: speechpy.main | ||
|
||
|
||
:hidden:`MFCC` | ||
~~~~~~~~~~~~~~ | ||
|
||
.. autofunction:: speechpy.main.mfcc | ||
|
||
|
||
:hidden:`Mel Frequency Energy` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. autofunction:: speechpy.main.mfe | ||
|
||
|
||
:hidden:`Log Mel Frequency Energy` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. autofunction:: speechpy.main.lmfe | ||
|
||
|
||
:hidden:`Extract Derivative Features` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. autofunction:: speechpy.main.extract_derivative_feature |
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,2 @@ | ||
from .main import * | ||
from .processing import * | ||
|
||
import feature | ||
import processing |
Empty file.
File renamed without changes.
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,43 @@ | ||
from __future__ import division | ||
import numpy as np | ||
from . import feature | ||
from scipy.fftpack import dct | ||
import math | ||
|
||
|
||
def frequency_to_mel(f): | ||
"""converting from frequency to Mel scale. | ||
|
||
:param f: The frequency values(or a single frequency) in Hz. | ||
:returns: The mel scale values(or a single mel). | ||
""" | ||
return 1127 * np.log(1 + f / 700.) | ||
|
||
|
||
def mel_to_frequency(mel): | ||
"""converting from Mel scale to frequency. | ||
|
||
:param mel: The mel scale values(or a single mel). | ||
:returns: The frequency values(or a single frequency) in Hz. | ||
""" | ||
return 700 * (np.exp(mel / 1127.0) - 1) | ||
|
||
|
||
def triangle(x, left, middle, right): | ||
out = np.zeros(x.shape) | ||
out[x <= left] = 0 | ||
out[x >= right] = 0 | ||
first_half = np.logical_and(left < x, x <= middle) | ||
out[first_half] = (x[first_half] - left) / (middle - left) | ||
second_half = np.logical_and(middle <= x, x < right) | ||
out[second_half] = (right - x[second_half]) / (right - middle) | ||
return out | ||
|
||
|
||
def zero_handling(x): | ||
""" | ||
This function handle the issue with zero values if the are exposed to become an argument for any lof function. | ||
:param x: The vector. | ||
:return: The vector with zeros substituted with epsilon values. | ||
""" | ||
return np.where(x == 0, np.finfo(float).eps, x) |
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