lspdf
Functions
-
int main(int argc, char *argv[])
lspdf [ option ] wfile [ infile ]
-m int
order of coefficients \((0 \le M)\)
-p int
frame period \((1 \le P)\)
-i int
interpolation period \((0 \le I \le P/2)\)
-k int
input gain type
0
linear gain1
log gain2
unity gain
wfile str
double-type LSP coefficients
infile str
double-type input sequence
stdout
double-type output sequence
In the below example, an excitation signal generated from pitch information is passed through the synthesis filter built from LSP coefficients.
excite < data.pitch | lspdf data.lsp > data.syn
- Parameters:
argc – [in] Number of arguments.
argv – [in] Argument vector.
- Returns:
0 on success, 1 on failure.
-
class LineSpectralPairsDigitalFilter
Apply line spectral pairs (LSP) digital filter to signals.
The transfer function \(H(z)\) of LSP filter is
\[ H(z) = \displaystyle\frac{K}{1 + \frac{P(z) - 1 + Q(z) - 1}{2}}, \]where\[\begin{split}\begin{eqnarray} P(z)&=&(1-z^{-1})\prod_{m=2,4,\ldots}^M (1-2\cos\omega(m)z^{-1}+z^{-2}), \\ Q(z)&=&(1+z^{-1})\prod_{m=1,3,\ldots}^M (1-2\cos\omega(m)z^{-1}+z^{-2}). \end{eqnarray}\end{split}\]Given the \(M\)-th order filter coefficients,
\[ \begin{array}{cccc} K, & \omega(1), & \ldots, & \omega(M), \end{array} \]an output signal is obtained by applying \(H(z)\) to an input signal in time domain.[1] N. Sugamura and F. Itakura, “Speech data compression by LSP speech analysis-synthesis technique,” Journal of IEICE, vol. J64-A, no. 8, pp. 599-606, 1981.
Public Functions
-
explicit LineSpectralPairsDigitalFilter(int num_filter_order)
- Parameters:
num_filter_order – [in] Order of filter coefficients, \(M\).
-
inline int GetNumFilterOrder() const
- Returns:
Order of coefficients.
-
inline bool IsValid() const
- Returns:
True if this object is valid.
-
bool Run(const std::vector<double> &filter_coefficients, double filter_input, double *filter_output, LineSpectralPairsDigitalFilter::Buffer *buffer) const
- Parameters:
filter_coefficients – [in] \(M\)-th order LSP filter coefficients.
filter_input – [in] Input signal.
filter_output – [out] Output signal.
buffer – [inout] Buffer.
- Returns:
True on success, false on failure.
-
bool Run(const std::vector<double> &filter_coefficients, double *input_and_output, LineSpectralPairsDigitalFilter::Buffer *buffer) const
- Parameters:
filter_coefficients – [in] \(M\)-th order LSP filter coefficients.
input_and_output – [inout] Input/output signal.
buffer – [inout] Buffer.
- Returns:
True on success, false on failure.
-
class Buffer
Buffer for LineSpectralPairsDigitalFilter class.
-
explicit LineSpectralPairsDigitalFilter(int num_filter_order)