<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ecg_simulate(duration=10, sampling_rate=1000, bpm=60, noise=0.01):
 """ Simulates an ECG signal. Parameters duration : int Desired recording length. sampling_rate : int Desired sampling rate. bpm : int Desired simulated heart rate. noise : float Desired noise level. Returns ECG_Response : dict Event-related ECG response features. Example Notes *Authors* - `Diarmaid O Cualain <https://github.com/diarmaidocualain>`_ - `Dominique Makowski <https://dominiquemakowski.github.io/>`_ *Dependencies* - numpy - scipy.signal References """

    # The "Daubechies" wavelet is a rough approximation to a real, single, cardiac cycle
    cardiac = scipy.signal.wavelets.daub(10)
    # Add the gap after the pqrst when the heart is resting.
    cardiac = np.concatenate([cardiac, np.zeros(10)])

    # Caculate the number of beats in capture time period
    num_heart_beats = int(duration * bpm / 60)

    # Concatenate together the number of heart beats needed
    ecg = np.tile(cardiac , num_heart_beats)

    # Add random (gaussian distributed) noise
    noise = np.random.normal(0, noise, len(ecg))
    ecg = noise + ecg

    # Resample
    ecg = scipy.signal.resample(ecg, sampling_rate*duration)

    return(ecg)