lspcheck

Functions

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

lspcheck [ option ] [ infile ]

  • -m int

    • order of line spectral pairs (0M)

  • -s double

    • sampling rate (0<Fs)

  • -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 (0R1)

  • -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π/(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:

K,ω(1),,ω(M),
and the output is the modified M-th order LSP:
K,ω(1),,ω(M).
The stability of LSP can be written as
ω(1)δ,ω(m)ω(m1)δ,(1<m<M)ω(M)πδ,
where 0δπ/(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, δ.

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.