lspcheck

Functions

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

lspcheck [ option ] [ infile ]

  • -m int

    • order of line spectral pairs \((0 \le M)\)

  • -s double

    • sampling rate \((0 < F_s)\)

  • -k int

    • input gain type

      • 0 linear gain

      • 1 log gain

      • 2 without gain

  • -q int

    • input format

      • 0 frequency in rad

      • 1 frequency in cyc

      • 2 frequency in kHz

      • 3 frequency in Hz

  • -o int

    • output format

      • 0 frequency in rad

      • 1 frequency in cyc

      • 2 frequency in kHz

      • 3 frequency in Hz

  • -e int

    • warning type

      • 0 no warning

      • 1 output index

      • 2 output index and exit immediately

  • -r double

    • rate of distance between adjacent LSPs \((0 \le R \le 1)\)

  • -g double

    • minimum gain on linear scale \((0 < G)\)

  • -x

    • perform modification

  • infile str

    • double-type LSP coefficients

  • stdout

    • double-type modified LSP coefficients

In the following example, 9-th order LSP coefficients in data.lsp are modified so that the distance between two adjacent LSPs is greater than \(0.01\pi/(M+1)\).

lspcheck -m 9 -r 0.01 -x < data.lsp > data2.lsp
Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

lspdf lpc2lsp lsp2lpc

class LineSpectralPairsStabilityCheck

Check stability of line spectral pairs and modify them.

The input is the \(M\)-th order LSP:

\[ \begin{array}{cccc} K, & \omega(1), & \ldots, & \omega(M), \end{array} \]
and the output is the modified \(M\)-th order LSP:
\[ \begin{array}{cccc} K, & \omega'(1), & \ldots, & \omega'(M). \end{array} \]
The stability of LSP can be written as
\[\begin{split}\begin{eqnarray} \omega(1) &\ge& \delta, \\ \omega(m) - \omega(m - 1) &\ge& \delta, \quad (1 < m < M) \\ \omega(M) &\le& \pi - \delta, \\ \end{eqnarray}\end{split}\]
where \(0 \le \delta \le \pi/(M + 1)\).

Public Functions

LineSpectralPairsStabilityCheck(int num_order, double minimum_distance)
Parameters:
  • num_order[in] Order of LSP, \(M\).

  • minimum_distance[in] Minimum distance between lines, \(\delta\).

inline int GetNumOrder() const
Returns:

Order of coefficients.

inline double GetMinimumDistance() const
Returns:

Minimum distance between lines.

inline bool IsValid() const
Returns:

True if this object is valid.

bool Run(const std::vector<double> &line_spectral_pairs, std::vector<double> *modified_line_spectral_pairs, bool *is_stable) const
Parameters:
  • line_spectral_pairs[in] \(M\)-th order LSP.

  • modified_line_spectral_pairs[out] Modified \(M\)-th order LSP (optional).

  • is_stable[out] True if the given coefficients are stable.

Returns:

True on success, false on failure.

bool Run(std::vector<double> *input_and_output, bool *is_stable) const
Parameters:
  • input_and_output[inout] \(M\)-th order coefficients.

  • is_stable[out] True if the given coefficients are stable.

Returns:

True on success, false on failure.