freqt

Functions

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

freqt [ option ] [ infile ]

  • -m int

    • order of minimum phase sequence (0M1)

  • -M int

    • order of warped sequence (0M2)

  • -a double

    • all-pass constant of input sequence (|α1|<1)

  • -A double

    • all-pass constant of output sequence (|α2|<1)

  • infile str

    • double-type minimum phase sequence

  • stdout

    • double-type warped sequence

The below example converts LPC coefficients into LPC mel-cepstral coefficients:

lpc2c < data.lpc | freqt -A 0.42 > data.lpcmc

The converted LPC mel-cepstral coefficients can be reverted if M2 is sufficiently greater than M1:

freqt -A -0.42 < data.lpcmc > data.lpc
Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

mgc2mgc

class FrequencyTransform

Transform a minimum phase sequence into a frequency-warped sequence.

The input is the M1-th order minimum phase sequence:

cα1(0),cα1(1),,cα1(M1),
and the output is the M2-th order frequency-warped sequence:
cα2(0),cα2(1),,cα2(M2).
The output sequence can be obtained by using the following recursion formula:
cα2(i)(m)={cα1(i)+αcα2(i1)(0),m=0(1α2)cα2(i1)(0)+αcα2(i1)(1),m=1cα2(i1)(m1)+α(cα2(i1)(m)cα2(i)(m1)),m=2,3,,M2i=M1,,1,0
where
α=(α2α1)/(1α1α2).
The initial condition of the recursion is cα2(M11)(m)=0 for any m.

The transformation is based on the cascade of all-pass networks. For more detail, see [1]. Note that the above recursion can be represented as a linear transformation, i.e., matrix multiplication.

[1] A. Oppenheim and D. Johnson, “Discrete representation of signals,” Proc. of the IEEE, vol. 60, no. 6, pp. 681-691, 1972.

[2] K. Tokuda, T. Kobayashi, T. Masuko, and S. Imai, “Mel-generalized cepstral representation of speech - A unified approach to speech spectral estimation,” Proc. of ICSLP 1994, pp. 1043-1046, 1994.

Public Functions

FrequencyTransform(int num_input_order, int num_output_order, double alpha)
Parameters:
  • num_input_order[in] Order of input, M1.

  • num_output_order[in] Order of output, M2.

  • alpha[in] Frequency warping factor, α.

inline int GetNumInputOrder() const
Returns:

Order of input.

inline int GetNumOutputOrder() const
Returns:

Order of output.

inline double GetAlpha() const
Returns:

Frequency warping factor.

inline bool IsValid() const
Returns:

True if this object is valid.

bool Run(const std::vector<double> &minimum_phase_sequence, std::vector<double> *warped_sequence, FrequencyTransform::Buffer *buffer) const
Parameters:
  • minimum_phase_sequence[in] M1-th order input sequence.

  • warped_sequence[out] M2-th order output sequence.

  • buffer[out] Buffer.

Returns:

True on success, false on failure.

class Buffer

Buffer for FrequencyTransform class.