fftcep

Functions

int main(int argc, char *argv[])

fftcep [ option ] [ infile ]

  • -l int

    • FFT length \((2 \le N)\)

  • -m int

    • order of coefficients \((0 \le M \le N/2)\)

  • -i int

    • number of iterations \((0 \le J)\)

  • -a double

    • acceleration factor \((0 \le \alpha)\)

  • -q int

    • input format

      • 0 amplitude spectrum in dB

      • 1 log amplitude spectrum

      • 2 amplitude spectrum

      • 3 power spectrum

      • 4 windowed waveform

  • -e double

    • small value added to power spectrum

  • -E double

    • relative floor in decibels

  • infile str

    • double-type windowed sequence or spectrum

  • stdout

    • double-type cepstral coefficients

If \(J>0\), the improved cepstral analysis method is performed.

The below example extracts 24-th order cepstral coefficients from data.d.

frame -p 80 -l 400 < data.d | window -l 400 -L 512 |
  fftcep -m 24 -l 512 > data.cep
Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

mgcep

class FastFourierTransformCepstralAnalysis

Calculate cepstrum from power spectrum.

The input is the half of power spectrum:

\[ \begin{array}{cccc} |X(0)|^2, & |X(1)|^2, & \ldots, & |X(N/2)|^2, \end{array} \]
where \(N\) is the FFT length. The output is the \(M\)-th order cepstral coefficients:
\[ \begin{array}{cccc} c(0), & c(1), & \ldots, & c(M). \end{array} \]
The cepstral coefficients is obtained by applying the logarithmic fucntion and the inverse FFT to the input power spectrum. However, the envelope derived from the cepstral coefficients is not robust to the change of the fine structure. To solve the problem, the improved cepstral analysis method has been proposed. The algorithm attempts to estimate the true envelope in an iterative manner. Only a few iteration, e.g., \(J=3\), is sufficient to estimate a good envelope. To speed up the convergence, the acceleration factor, \(\alpha\), is introduced where \(\alpha=0\) means no acceleration. For the detail, see [1].

[1] S. Imai and Y. Abe, “Spectral envelope extraction by improved cepstral method,” Journal of IEICE, vol. J62-A, no. 4, pp. 217-223, 1979 (Japanese).

Public Functions

FastFourierTransformCepstralAnalysis(int fft_length, int num_order, int num_iteration, double acceleration_factor)
Parameters:
  • fft_length[in] Number of FFT bins, \(N\).

  • num_order[in] Order of cepstral coefficients, \(M\).

  • num_iteration[in] Number of iterations of the improved cepstral analysis method, \(J\).

  • acceleration_factor[in] Acceleration factor, \(\alpha\).

inline int GetFftLength() const
Returns:

FFT length.

inline int GetNumOrder() const
Returns:

Order of coefficients.

inline int GetNumIteration() const
Returns:

Number of iterations.

inline double GetAccelarationFactor() const
Returns:

Accelaration factor.

inline bool IsValid() const
Returns:

True if this object is valid.

bool Run(const std::vector<double> &power_spectrum, std::vector<double> *cepstrum, FastFourierTransformCepstralAnalysis::Buffer *buffer) const
Parameters:
  • power_spectrum[in] \((N/2+1)\)-length power spectrum.

  • cepstrum[out] \(M\)-th order cepstral coefficients.

  • buffer[out] Buffer.

Returns:

True on success, false on failure.

class Buffer

Buffer for FastFourierTransformCepstralAnalysis class.