calpy.entropy package¶
Submodules¶
calpy.entropy.entropy module¶
-
calpy.entropy.entropy.
entropy_profile
(symbols, window_size=100, window_overlap=0)[source]¶ Calculate the entropy profile of a list of symbols.
- Args:
- symbols (numpy.array or list (int)): A list of symbols. window_size (int, optional): Number of symbols per entropy window. Defaults to 100. window_overlap (int, optional): How much the entropy windows should overlap. Defaults to 0.
- Returns:
- numpy.array(float): The entropy profile.
-
calpy.entropy.entropy.
entropy_profile_2D
(symbols, window_size=100, window_overlap=0)[source]¶ Calculate the 2D entropy profile of symbols (typically mfcc with axis 1 as time).
- Args:
- symbols (2D numpy.array (int)): Symbols of 2 dimensions. window_size (int, optional): Number of symbols per entropy window. Defaults to 100. window_overlap (int, optional): How much the entropy windows should overlap. Defaults to 0.
- Returns:
- 2D numpy.array(float): The 2D entropy profile.
-
calpy.entropy.entropy.
estimate_Gaussian
(X)[source]¶ Estimate the parametres of a Gaussian distribution using X
- Args:
- X (numpy.array (float)): Training dataset with features along axis 0, and examples along axis 1.
- Returns:
- Mu (numpy.array (float)): mean of the X (n by 1 dimension). Sigma2 (numpy.array (float)): variance of X (n by 1 dimension).
-
calpy.entropy.entropy.
multivariate_Gaussion
(X, Mu, Sigma2)[source]¶ Computes the probability density function of multivariate Gaussian distribution.
- Args:
- X (1D numpy.array (float)): n by 1 feature vector. Mu (1D numpy.array (float)): n by 1 mean vector. Sigma2 (1D numpy.array (float)): n by 1 variance vector.
- Returns:
- p (float): probability of input X.
-
calpy.entropy.entropy.
symbolise
(pitches, eps=0.08)[source]¶ Symbolose a small piece of speech segment according to pitch slopes.
- Args:
- pitches (numpy.array or list (float)): A list of pitches. eps (float, optional): Treshold of pitch slopes to be considered level. Defaults to tan(5 degrees).
- Returns:
- int: one symbol of the small piece of speech segment.
-
calpy.entropy.entropy.
symbolise_mfcc
(mfcc)[source]¶ Symbolise speech according to mfcc.
- Args:
- mfcc (2D numpy.array (float)): A list of mfcc, axis 1 is time and axis 0 is mfcc
- Returns:
- symbols (numpy.array (float)): A list of symbols.
-
calpy.entropy.entropy.
symbolise_mfcc_multidimension
(mfcc)[source]¶ Symbolise speech in multi-dimensional scale according to mfcc.
- Args:
- mfcc (2D numpy.array (float)): A list of mfcc, axis 1 is time and axis 0 is mfcc
- Returns:
- symbols (2D numpy.array(int)): Multi-dimensional symbols. A 2D numpy.array with the same shape as input mfcc
-
calpy.entropy.entropy.
symbolise_pauses
(pause_A, pause_B)[source]¶ symbolise a conversation between two speakers into 63 patterns with their pause profiles.
- Args:
- pause_A (numpy.array(int)): 0-1 1D numpy integer array with 1s marking pause of speaker A. pause_B (numpy.array(int)): 0-1 1D numpy integer array with 1s marking pause of speaker B.
- Returns:
- symbols (numpy.array(int)): a 2D numpy.array with shape (64, pause_A.shape[0]). Axis 1 is the temporal dimension and axis 0 marks the pattern
-
calpy.entropy.entropy.
symbolise_speech
(pitches, pauses, thre=250)[source]¶ Symbolise a small speech segment according to pitch and pause.
- Args:
- pitches (numpy.array(float)): A list of pitches. pauses (numpy.array(int)): A list of pauses. thre (float, optional): Threshold of high pitch.
- Returns:
- int: one symbol of the small speech segment.