code: def ecg_simulate(duration=10, sampling_rate=1000, bpm=60, noise=0.01):
      
      # 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)
docs: 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
      ----------
      >>> import neurokit as nk
      >>> import pandas as pd
      >>>
      >>> ecg = nk.ecg_simulate(duration=10, bpm=60, sampling_rate=1000, noise=0.01)
      >>> pd.Series(ecg).plot()
  
      Notes
      ----------
      *Authors*
  
      - `Diarmaid O Cualain <https://github.com/diarmaidocualain>`_
      - `Dominique Makowski <https://dominiquemakowski.github.io/>`_
  
      *Dependencies*
  
      - numpy
      - scipy.signal
  
      References
      -----------