def lsf2poly(lsf):
<EOL>lsf = numpy.array(lsf)<EOL>if max(lsf) > numpy.pi or min(lsf) < <NUM_LIT:0>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>p = len(lsf) <EOL>z  = numpy.exp(<NUM_LIT> * lsf)<EOL>rQ = z[<NUM_LIT:0>::<NUM_LIT:2>]<EOL>rP = z[<NUM_LIT:1>::<NUM_LIT:2>]<EOL>rQ = numpy.concatenate((rQ, rQ.conjugate()))<EOL>rP = numpy.concatenate((rP, rP.conjugate()))<EOL>Q  = numpy.poly(rQ);<EOL>P  = numpy.poly(rP);<EOL>if p%<NUM_LIT:2>:<EOL><INDENT>P1 = numpy.convolve(P, [<NUM_LIT:1>, <NUM_LIT:0>, -<NUM_LIT:1>])<EOL>Q1 = Q<EOL><DEDENT>else:<EOL><INDENT>P1 = numpy.convolve(P, [<NUM_LIT:1>, -<NUM_LIT:1>])<EOL>Q1 = numpy.convolve(Q, [<NUM_LIT:1>,  <NUM_LIT:1>])<EOL><DEDENT>a = <NUM_LIT> * (P1+Q1)<EOL>return a[<NUM_LIT:0>:-<NUM_LIT:1>:<NUM_LIT:1>]<EOL>
Convert line spectral frequencies to prediction filter coefficients

    returns a vector a containing the prediction filter coefficients from a vector lsf of line spectral frequencies.

    .. doctest::

        >>> from spectrum import lsf2poly
        >>> lsf = [0.7842 ,   1.5605  ,  1.8776 ,   1.8984,    2.3593]
        >>> a = lsf2poly(lsf)

    # array([  1.00000000e+00,   6.14837835e-01,   9.89884967e-01,
    # 9.31594056e-05,   3.13713832e-03,  -8.12002261e-03 ])

    .. seealso:: poly2lsf, rc2poly, ac2poly, rc2is