Sign in

username:

password:



Not a member?

Search speechcoding



Search tips

Subscribe to speechcoding



speechcoding by Keywords

ACELP | ADPCM | AMBE | AMR | AMR-NB | CELP | Codebook | DTMF | G.723 | G.726 | G.729 | GSM | Interpolation | LPC | LSF | LSP | MELP | PCM | Perceptual | Pitch | PSOL | QCELP | Quantization | SMV | VAD | Vocoder

Discussion Groups

Discussion Groups | Speech Coding | LPC to LSF Source Code

Technical discussions related to Speech Coding (all itu and other vocoders, ACELP, CELP, AMR, etc)

  

Post a new Thread

LPC to LSF Source Code - ray....@gmail.com - Feb 18 7:36:00 2008



Hello;

I was wondering if anyone would be willing to share or direct me towards some Java or C code on
how to convert from Linear Prediction Coefficients to Line Spectral Frequencies and vice
versa.

I am able to generate the LP coefficients using the Levinson algorithm, but am looking for some
help to get to LS frequencies.
Thanks.

Regards,
Ray



(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )

Re: LPC to LSF Source Code - Hbin...@gmail.com - Mar 7 12:39:09 2008

please refer Itu G.729 source code.

Hello;
>
>I was wondering if anyone would be willing to share or direct me towards some Java or C
code on how to convert from Linear Prediction Coefficients to Line Spectral Frequencies and
vice versa.
>
>I am able to generate the LP coefficients using the Levinson algorithm, but am looking for
some help to get to LS frequencies.
>Thanks.
>
>Regards,
>Ray



(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )

Re: LPC to LSF Source Code - abdo...@yahoo.com - Jun 26 7:17:54 2008


Hello;
>
>I was wondering if anyone would be willing to share or direct me towards some Java or C
code on how to convert from Linear Prediction Coefficients to Line Spectral Frequencies and
vice versa.
>
>I am able to generate the LP coefficients using the Levinson algorithm, but am looking for
some help to get to LS frequencies.
>Thanks.
>
>Regards,
>Ray

hi,

This code provided in matlad
function lsf = poly2lsf(a)
%POLY2LSF Prediction polynomial to line spectral frequencies.
%   LSF = POLY2LSF(A) converts the prediction polynomial specified by A,
%   into the corresponding line spectral frequencies, LSF. 
%
%   POLY2LSF normalizes the prediction polynomial by A(1).
%
%   See also LSF2POLY, POLY2RC, POLY2AC, RC2IS. 
 
%   Author(s): A.Ramasubramanian
%   Copyright 1988-2002 The MathWorks, Inc.
%   $Revision: 1.7 $ $Date: 2002/04/15 01:15:43 $
%
%   Reference:
%   A.M. Kondoz, "Digital Speech: Coding for Low Bit Rate Communications
%   Systems" John Wiley & Sons 1994, Chapter 4. 
 
a  = a(:);
if ~isreal(a),
    error('Line spectral frequencies are not defined for complex polynomials.');
end
 
% Normalize the polynomial if a(1) is not unity
 
if a(1) ~= 1.0,
    a = a./a(1);
end
 
if (max(abs(roots(a))) >= 1.0),
    error('The polynomial must have all roots inside of the unit circle.');
end
 
% Form the sum and differnce filters
 
p  = length(a)-1;  % The leading one in the polynomial is not used
a1 = [a;0];        
a2 = a1(end:-1:1);
P1 = a1-a2;        % Difference filter
Q1 = a1+a2;        % Sum Filter 
 
% If order is even, remove the known root at z = 1 for P1 and z = -1 for Q1
% If odd, remove both the roots from P1
 
if rem(p,2),  % Odd order
    P = deconv(P1,[1 0 -1]);
    Q = Q1;
else          % Even order 
    P = deconv(P1,[1 -1]);
    Q = deconv(Q1,[1  1]);
end
 
rP  = roots(P);
rQ  = roots(Q);
 
aP  = angle(rP(1:2:end));
aQ  = angle(rQ(1:2:end));
 
lsf = sort([aP;aQ]);
 
% [EOF] poly2lsf.m

can you help me to solve this problem?
I need log spectral distortion formula between quantized LPC and original LPC.
------------------------------------



(You need to be a member of speechcoding -- send a blank email to speechcoding-subscribe@yahoogroups.com )