mgc2sp
Functions
- 
int main(int argc, char *argv[])
- mgc2sp [ option ] [ infile ] - -m int - order of coefficients \((0 \le M)\) 
 
- -a double - all-pass constant \((|\alpha| < 1)\) 
 
- -g double - gamma \((|\gamma| \le 1)\) 
 
- -c int - gamma \(\gamma = -1 / C\) \((1 \le C)\) 
 
- -n bool - regard as normalized mel-generalized cepstrum 
 
- -u bool - regard as multiplied by gamma 
 
- -l int - FFT length \((2 \le N)\) 
 
- -o int - output format - 0\(20 \log_{10} |H(z)|\)
- 1\(\log |H(z)|\)
- 2\(|H(z)|\)
- 3\(|H(z)|^2\)
- 4\(\arg|H(z)| / \pi\)
- 5\(\arg|H(z)|\)
- 6\(\arg|H(z)| \times 180/\pi\)
 
 
- infile str - double-type mel-generalized cepstral coefficients 
 
- stdout - double-type spectrum 
 
 - In the following example, 12-th order mel-generalized cepstral coefficients in - data.mgcepare converted to log magnitude spectrum.- mgc2sp -m 12 -a 0.35 -c 2 < data.mgcep > data.spec - Parameters
- argc – [in] Number of arguments. 
- argv – [in] Argument vector. 
 
- Returns
- 0 on success, 1 on failure. 
 
- 
class sptk::MelGeneralizedCepstrumToSpectrum
- Convert mel-generalized cepstrum to spectrum. - This is a simple combination of MelGeneralizedCepstrumToMelGeneralizedCepstrum and RealValuedFastFourierTransform. - Public Functions - 
MelGeneralizedCepstrumToSpectrum(int num_order, double alpha, double gamma, bool is_normalized, bool is_multiplied, int fft_length)
- Parameters
- num_order – [in] Order of coefficients, \(M\). 
- alpha – [in] All-pass constant, \(\alpha\). 
- gamma – [in] Exponent parameter, \(\gamma\). 
- is_normalized – [in] gain-normalized flag. 
- is_multiplied – [in] gamma-multiplied flag. 
- fft_length – [in] FFT length, \(N\). 
 
 
 - 
inline int GetNumOrder() const
- Returns
- Order of coefficients. 
 
 - 
inline double GetAlpha() const
- Returns
- Alpha. 
 
 - 
inline double GetGamma() const
- Returns
- Gamma. 
 
 - 
inline bool IsNormalized() const
- Returns
- True if input is gain-normalized. 
 
 - 
inline bool IsMultiplied() const
- Returns
- True if input is multiplied by gamma. 
 
 - 
inline int GetFftLength() const
- Returns
- FFT length. 
 
 - 
inline bool IsValid() const
- Returns
- True if this object is valid. 
 
 - 
bool Run(const std::vector<double> &mel_generalized_cepstrum, std::vector<double> *amplitude_spectrum, std::vector<double> *phase_spectrum, MelGeneralizedCepstrumToSpectrum::Buffer *buffer) const
- Parameters
- mel_generalized_cepstrum – [in] \(M\)-th order mel-generalized cepstrum. 
- amplitude_spectrum – [out] \(N\)-length amplitude spectrum. 
- phase_spectrum – [out] \(N\)-length phase spectrum. 
- buffer – [out] Buffer. 
 
- Returns
- True on success, false on failure. 
 
 - 
class Buffer
- Buffer for MelGeneralizedCepstrumToSpectrum class. 
 
- 
MelGeneralizedCepstrumToSpectrum(int num_order, double alpha, double gamma, bool is_normalized, bool is_multiplied, int fft_length)