csm2acr

Functions

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

csm2acr [ option ] [ infile ]

  • -m int

    • order of autocorrelation \((1 \le M)\)

  • infile str

    • double-type CSM parameters

  • stdout

    • double-type autocorrelation

The below example converts CSM parameters into autocorrelation coefficients:

csm2acr < data.csm > data.acr

The converted autocorrelation coefficients can be reverted by

acr2csm < data.acr > data.csm
Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

acr2csm acorr

class CompositeSinusoidalModelingToAutocorrelation

Convert CSM parameters to autocorrelation.

The input is the \(2N\) CSM parameters:

\[\begin{split} \begin{array}{cccc} \omega(1), & \omega(2), & \ldots, & \omega(N), \\ m(1), & m(2), & \ldots, & m(N), \end{array} \end{split}\]
where \(\omega(n)\) is the CSM frequency and \(m(n)\) is the CSM intensity. The output is the \((2N-1)\)-th order biased sample autocorrelation coefficients:
\[ \begin{array}{cccc} v(0), & v(1), & \ldots, & v(2N-1). \end{array} \]
The sample autocorrelation is given by
\[ v(l) = \sum_{i=1}^N m(i) \cos(l \, \omega(i)). \]

[1] S. Sagayama and F. Itakura, “Duality theory of composite sinusoidal modeling and linear prediction,” Proc. of ICASSP 1986, pp. 1261-1264, 1986.

Public Functions

explicit CompositeSinusoidalModelingToAutocorrelation(int num_sine_wave)
Parameters:

num_sine_wave[in] Number of sine waves, \(N\).

inline int GetNumSineWaves() const
Returns:

Number of sine waves.

inline bool IsValid() const
Returns:

True if this object is valid.

bool Run(const std::vector<double> &composite_sinusoidal_modeling, std::vector<double> *autocorrelation) const
Parameters:
  • composite_sinusoidal_modeling[in] CSM parameters.

  • autocorrelation[out] Autocorrelation coefficients.

Returns:

True on success, false on failure.

bool Run(std::vector<double> *input_and_output) const
Parameters:

input_and_output[inout] Input and output.

Returns:

True on success, false on failure.