def morlet(lb, ub, n):
if n <= <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>x = numpy.linspace(lb, ub, n)<EOL>psi = numpy.cos(<NUM_LIT:5>*x) * numpy.exp(-x**<NUM_LIT:2>/<NUM_LIT>)<EOL>return psi<EOL>
r"""Generate the Morlet waveform


    The Morlet waveform is defined as follows:

    .. math:: w[x] = \cos{5x}  \exp^{-x^2/2}

    :param lb: lower bound
    :param ub: upper bound
    :param int n: waveform data samples


    .. plot::
        :include-source:
        :width: 80%

        from spectrum import morlet
        from pylab import plot
        plot(morlet(0,10,100))