This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

dsp.LPCToLSP System object

Convert linear prediction coefficients to line spectral pairs


The LPCToLSP object converts linear prediction coefficients to line spectral pairs.

To convert LPC to LSP:

  1. Define and set up your LPC to LSP converter. See Construction.

  2. Call step to convert LPC according to the properties of dsp.LPCToLSP. The behavior of step is specific to each object in the toolbox.


Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


lpc2lsp = dsp.LPCToLSP returns a System object, lpc2lsp, that converts linear prediction coefficients (LPCs) to line spectral pairs (LSPs).

lpc2lsp = dsp.LPCToLSP('PropertyName',PropertyValue,...) returns an LPC to LSF System object, lpc2lsp, with each specified property set to the specified value.



Number of coarse subintervals used for finding roots (LSP values)

Specify the number of coarse subintervals, n, used for finding line spectral pairs (LSP) values, as a positive scalar integer. LSPs, which are the roots of two particular polynomials related to the input LPC polynomial, always lie in the range (–1, 1). The System object finds these roots using the Chebyshev polynomial root finding method. The object divides the interval (–1, 1) into n subintervals and looks for roots in each subinterval. If n is set to too small a number in relation to the LPC polynomial order, the object can fail to find some of the roots. The default is 64. This property is tunable.


Value of bisection refinement used for finding roots

Specify the root bisection refinement value, k, that the Chebyshev polynomial uses in the root finding method. For each line spectral pair (LSP) the output is within


of the actual LSP value. Here n is the value of the NumCoarseGridPoints property and the object searches a maximum of


points for finding the roots. The NumBisects property value k, must be a positive scalar integer. The default is 4. This property is tunable.


Produces output with validity status of LSP output

Set this property to true to return a second output that indicates whether the computed LSP values are valid. The object outputs a vector length equal to the number of channels. A logical value of 1 indicates the output is valid. A logical value of 0 indicates the output is invalid. The LSP outputs are invalid when the object fails to find all the LSP values or when the input LPCs are unstable. The default is false.


Enable overwriting invalid output with previous output

Specify the action that the object takes for invalid LSP outputs. When you set this property to true, the object overwrites the invalid output with the previous output. When you set this property to false, the object takes no action on invalid outputs and ignores the outputs.


Source of values for first output when output is invalid

Specify the source of values for the first output when the output is invalid as Auto or Property. This property applies only when you set the OverwriteInvalidOutput property to true. The default is Auto. When this property is Auto, the object uses a default value for the first output. The default value corresponds to the LSP representation of an allpass filter.


Value of first output

Specify a numeric vector of LSP values for overwriting an invalid first output. The length of this vector must be one less than the length of the input LPC vector. For multichannel inputs, set this property can to a matrix with the same number of channels as the input or one vector that you apply to every channel. The default is an empty vector. This property applies only when you set the OverwriteInvalidOutput property to true and the FirstOutputValuesSource property to Property.


First coefficient nonunity action

Specify the action that the object takes when the first coefficient of each channel of the LPC input is not equal to 1. Specify as one of Replace with 1 or Normalize. The default is Replace with 1.


resetReset values for overwriting invalid outputs to their initial values
stepConvert linear prediction coefficients to line spectral pairs
Common to All System Objects

Create System object with same property values


Expected number of inputs to a System object


Expected number of outputs of a System object


Check locked states of a System object (logical)


Allow System object property value changes


expand all

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

Convert the linear prediction coefficients to line spectral pairs.

a = [1.0000 0.6149 0.9899 0.0000 0.0031 -0.0082]';
lpc2lsp = dsp.LPCToLSP;
y = lpc2lsp(a); % Convert to LSP coefficients


This object implements the algorithm, inputs, and outputs described on the LPC to LSF/LSP Conversion block reference page. The object properties correspond to the block parameters, except:

No object property corresponds to the Output block parameter. The object only supports LSP outputs.

Extended Capabilities

Introduced in R2012a

Was this topic helpful?