<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def morlet(freq, s_freq, ratio=5, sigma_f=None, dur_in_sd=4, dur_in_s=None, normalization='peak', zero_mean=False):
 """Create a Morlet wavelet. Parameters freq : float central frequency of the wavelet s_freq : int sampling frequency ratio : float ratio for a wavelet family ( = freq / sigma_f) sigma_f : float standard deviation of the wavelet in frequency domain dur_in_sd : float duration of the wavelet, given as number of the standard deviation in the time domain, in one side. dur_in_s : float total duration of the wavelet, two-sided (i.e. from start to finish) normalization : str 'area' means that energy is normalized to 1, 'peak' means that the peak is set at 1, 'max' is a normalization used by nitime which does not change max value of output when you change sigma_f. zero_mean : bool make sure that the wavelet has zero mean (only relevant if ratio < 5) Returns ------- ndarray vector containing the complex Morlet wavelets Notes ----- 'ratio' and 'sigma_f' are mutually exclusive. If you use 'sigma_f', the standard deviation stays the same for all the frequency. It's more common to specify a constant ratio for the wavelet family, so that the frequency resolution changes with the frequency of interest. 'dur_in_sd' and 'dur_in_s' are mutually exclusive. 'dur_in_s' specifies the total duration (from start to finish) of the window. 'dur_in_sd' calculates the total duration as the length in standard deviations in the time domain: dur_in_s = dur_in_sd * 2 * sigma_t, with sigma_t = 1 / (2 * pi * sigma_f) """

    if sigma_f is None:
        sigma_f = freq / ratio
    else:
        ratio = freq / sigma_f
    sigma_t = 1 / (2 * pi * sigma_f)

    if ratio < 5 and not zero_mean:
        lg.info('The wavelet won\'t have zero mean, set zero_mean=True to '
                'correct it')

    if dur_in_s is None:
        dur_in_s = sigma_t * dur_in_sd * 2

    t = arange(-dur_in_s / 2, dur_in_s / 2, 1 / s_freq)

    w = exp(1j * 2 * pi * freq * t)
    if zero_mean:
        w -= exp(-1 / 2 * ratio ** 2)

    w *= exp(-t ** 2 / (2 * sigma_t ** 2))

    if normalization == 'area':
        w /= sqrt(sqrt(pi) * sigma_t * s_freq)
    elif normalization == 'max':
        w /= 2 * sigma_t * sqrt(2 * pi) / s_freq
    elif normalization == 'peak':
        pass

    lg.info('At freq {0: 9.3f}Hz, sigma_f={1: 9.3f}Hz, sigma_t={2: 9.3f}s, '
            'total duration={3: 9.3f}s'.format(freq, sigma_f, sigma_t,
                                               dur_in_s))
    lg.debug('    Real peak={0: 9.3f}, Mean={1: 12.6f}, '
             'Energy={2: 9.3f}'.format(max(real(w)), mean(w), norm(w) ** 2))

    return w