amgcep
Functions
-
int main(int argc, char *argv[])
amgcep [ option ] [ infile ]
-m int
order of mel-cepstral coefficients
-a double
all-pass constant
-c int
gamma
-e double
minimum epsilon
-t double
momentum
-l double
forgetting factor
-s double
step-size factor
-p int
output period
-P int
order of Pade approximation
-E str
double-type prediction errors
-k
filtering without gain (valid with -E)
infile str
double-type input signals
stdout
double-type mel-generalized cepstral coefficients
The below example extracts 15-th order mel-cepstral coefficients for every block of 100 samples.
amgcep -m 15 -p 100 < data.raw > data.mcep
The smoothed mel-cepstral coefficients can be computed as
amgcep -m 15 -p 1 < data.raw | vstat -m 15 -t 100 -o 1 > data.mcep
15-th order generalized cepstral coefficients can be obtained as
amgcep -m 15 -c 1 -a 0 < data.raw > data.gcep
- Parameters:
argc – [in] Number of arguments.
argv – [in] Argument vector.
- Returns:
0 on success, 1 on failure.
-
class AdaptiveMelCepstralAnalysis
Perform adaptive mel-cesptral analysis.
The block diagram of the adaptive mel-cepstral analysis is shown as below:
where
is an input signal and is the output of the inverse filter . The is implemented as a MLSA filter. The coefficients of the MLSA filter is updated every sample as is the step-size factor and is the forgetting factor. If is less than , is set to . The estimate of is is the momentum and is the set of outputs of the filter :The coefficients of the MLSA filter are converted to the mel-cepstral coefficients by a linear transformation.
Public Functions
-
AdaptiveMelCepstralAnalysis(int num_order, int num_pade_order, double alpha, double min_epsilon, double momentum, double forgetting_factor, double step_size_factor, bool gain_flag)
- Parameters:
num_order – [in] Order of mel-cepstral coefficients,
.num_pade_order – [in] Order of Pade approximation.
alpha – [in] Frequency warping factor,
.min_epsilon – [in] Minimum value of
.momentum – [in] Momentum,
.forgetting_factor – [in] Forgetting factor,
.step_size_factor – [in] Step-size factor,
.gain_flag – [in] If true, perform filtering with gain.
-
inline int GetNumOrder() const
- Returns:
Order of mel-cepstral coefficients.
-
inline int GetNumPadeOrder() const
- Returns:
Order of Pade approximation.
-
inline double GetAlpha() const
- Returns:
Frequency warping factor.
-
inline double GetMinEpsilon() const
- Returns:
Minimum epsilon.
-
inline double GetMomentum() const
- Returns:
Momentum.
-
inline double GetForgettingFactor() const
- Returns:
Forgetting factor.
-
inline double GetStepSizeFactor() const
- Returns:
Step-size factor.
-
inline bool GetGainFlag() const
- Returns:
Gain flag.
-
inline bool IsValid() const
- Returns:
True if this object is valid.
-
bool Run(double input_signal, double *prediction_error, std::vector<double> *mel_cepstrum, AdaptiveMelCepstralAnalysis::Buffer *buffer) const
- Parameters:
input_signal – [in] An input signal,
.prediction_error – [out] A prediction error,
.mel_cepstrum – [out]
-th order mel-cepstral coefficients.buffer – [inout] Buffer.
- Returns:
True on success, false on failure.
-
class Buffer
Buffer for AdaptiveMelCepstralAnalysis class.
-
AdaptiveMelCepstralAnalysis(int num_order, int num_pade_order, double alpha, double min_epsilon, double momentum, double forgetting_factor, double step_size_factor, bool gain_flag)
-
class AdaptiveGeneralizedCepstralAnalysis
Perform adaptive generalized cesptral analysis.
Let assume
is an input signal and is the output of the inverse filter . The relationship between and is shown as below:The filter
is represented as is the normalized generalized cepstral coefficients. The coefficients of the filter is updated every sample as is the step-size factor and is the forgetting factor. If is less than , is set to . The estimate of is is the momentum and is the set of outputs of the filter .The coefficients of the filter
are denormalized to obtain the generalized cepstral coefficients.Public Functions
-
AdaptiveGeneralizedCepstralAnalysis(int num_order, int num_stage, double min_epsilon, double momentum, double forgetting_factor, double step_size_factor, bool gain_flag)
- Parameters:
num_order – [in] Order of cepstral coefficients,
.num_stage – [in] Number of stages,
.min_epsilon – [in] Minimum value of
.momentum – [in] Momentum,
.forgetting_factor – [in] Forgetting factor,
.step_size_factor – [in] Step-size factor,
.gain_flag – [in] If true, perform filtering with gain.
-
inline int GetNumOrder() const
- Returns:
Order of cepstral coefficients.
-
inline int GetNumStage() const
- Returns:
Number of stages.
-
inline double GetGamma() const
- Returns:
Gamma.
-
inline double GetMinEpsilon() const
- Returns:
Minimum epsilon.
-
inline double GetMomentum() const
- Returns:
Momentum.
-
inline double GetForgettingFactor() const
- Returns:
Forgetting factor.
-
inline double GetStepSizeFactor() const
- Returns:
Step-size factor.
-
inline bool GetGainFlag() const
- Returns:
Gain flag.
-
inline bool IsValid() const
- Returns:
True if this object is valid.
-
bool Run(double input_signal, double *prediction_error, std::vector<double> *generalized_cepstrum, AdaptiveGeneralizedCepstralAnalysis::Buffer *buffer) const
- Parameters:
input_signal – [in] An input signal,
.prediction_error – [out] A prediction error,
.generalized_cepstrum – [out]
-th order generalized cepstral coefficients.buffer – [inout] Buffer.
- Returns:
True on success, false on failure.
-
class Buffer
Buffer for AdaptiveGeneralizedCepstralAnalysis class.
-
AdaptiveGeneralizedCepstralAnalysis(int num_order, int num_stage, double min_epsilon, double momentum, double forgetting_factor, double step_size_factor, bool gain_flag)