def wlogmorlet_fft(f0, sd, sampling_rate, ns=5, nt=None):
    """
    returns a complex log morlet wavelet in the frequency domain

    Parameters
    ----------
        f0 : center frequency
        sd : standard deviation
        sampling_rate : samplingrate
        ns : window length in number of standard deviations
        nt : window length in number of sample points
    """
    if nt == None:
        st = 1. / (2. * np.pi * sd)
        nt = 2 * int(ns * st * sampling_rate) + 1
    f = fftpack.fftfreq(nt, 1. / sampling_rate)

    sfl = np.log(1 + 1. * sd / f0)
    wf = (2 * np.exp(-(np.log(f) - np.log(f0)) ** 2 / (2 * sfl ** 2)) *
          np.sqrt(sampling_rate / (np.sqrt(np.pi) * sd)))
    wf[f < 0] = 0
    wf[f == 0] /= 2
    return wf
dataset/ETHPy150Open nipy/nitime/nitime/algorithms/wavelet.py/wlogmorlet_fft/original