dsp.LPCToLSF System object

Package: dsp

Convert linear prediction coefficients to line spectral frequencies


The LPCToLSF object converts linear prediction coefficients to line spectral frequencies.

To convert LPC to LSF:

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

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


H = dsp.LPCToLSF returns a System object™, H, that converts linear prediction coefficients (LPCs) to line spectral frequencies (LSFs).

H = dsp.LPCToLSF('PropertyName',PropertyValue,...) returns an LPC to LSF System object, H, 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. To compute LSF outputs, the object computes the arc cosine of the LSPs, outputting values ranging from 0 to pi radians. The object divides the interval (–1, 1) into n subintervals and looks for roots in each subinterval. If you set n too small 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, used in the Chebyshev polynomial root finding method, where each line spectral pair (LSP) output is within


of the actual LSP value. Here n is the value of the NumCoarseGridPoints property, and the object searches a maximum of k(n1) points for finding the roots. You must set the NumBisects property value k, to a positive scalar integer. The default is 4. This property is tunable.


Produces output with validity status of LSF output

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


Enable overwriting invalid output with previous output

Specify the action that the System object should take for invalid LSF 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 does not take any 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 when you set the OverwriteInvalidOutput property to true. The default is Auto. When you set this property to Auto, the object uses a default value for the first output. The default value corresponds to the LSF representation of an allpass filter.


Value of the first output

Specify a numeric vector of LSF 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, you can set this property to a matrix with the same number of channels as the input, or one vector that is applied to every channel. The default is an empty vector. This property applies when you set the OverwriteInvalidOutput property to true and the FirstOutputValuesSource property to Property.


Action to take when first LPC coefficient is not 1

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


cloneCreate LPC To LSF object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
resetReset values for overwriting invalid outputs to their initial values
stepConvert LPC coefficients to line spectral frequencies


Convert to linear prediction coefficients to line spectral frequencies:

 a = [1.0000 0.6149 0.9899 0.0000 0.0031 -0.0082]';
 hlpc2lsf = dsp.LPCToLSF;
 y = step(hlpc2lsf, a); % Convert to LSF 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:

There is no object property that corresponds to the Output block parameter. The object only supports LSF outputs in the range (0,)
Was this topic helpful?