code: def _buffer_ini(data, sample_rate):
      
      rr_buffer = [1] * 8
      spk1 = max(data[sample_rate:2*sample_rate])
      npk1 = 0
      threshold = _buffer_update(npk1, spk1)
  
      return rr_buffer, spk1, npk1, threshold
docs: Initializes the buffer with eight 1s intervals
  
      ----------
      Parameters
      ----------
      data : ndarray
          Pre-processed ECG signal samples.
      sample_rate : int
          Sampling rate at which the acquisition took place.
  
      Returns
      -------
      rr_buffer : list
          Data structure that stores eight samples (in the future this buffer will store the duration
          of eight RR intervals instead of the 1 second values defined in initialisation).
      spk1 : float
          Initial value of SPK1 parameter defined in Pan-Tompkins real-time R peak detection algorithm
          (named signal peak).
      npk1 : int
          Initial value of NPK1 parameter defined in Pan-Tompkins real-time R peak detection algorithm
          (named noise peak).
      threshold : float
          Initial value of the adaptive threshold level (relevant parameter for the application of
          specific criteria during the identification of R peaks).
  
      Sources
      -------
      https://www.robots.ox.ac.uk/~gari/teaching/cdt/A3/readings/ECG/Pan+Tompkins.pdf