Update live qrs parameters. Adjust the recent rr-intervals and
        qrs amplitudes, and the qrs threshold.

        Parameters
        ----------
        peak_num : int
            The peak number of the mwi signal where the qrs is detected
        backsearch: bool, optional
            Whether the qrs was found via backsearch

def _update_qrs(self, peak_num, backsearch=False):
        """
        Update live qrs parameters. Adjust the recent rr-intervals and
        qrs amplitudes, and the qrs threshold.

        Parameters
        ----------
        peak_num : int
            The peak number of the mwi signal where the qrs is detected
        backsearch: bool, optional
            Whether the qrs was found via backsearch
        """

        i = self.peak_inds_i[peak_num]

        # Update recent rr if the beat is consecutive (do this before
        # updating self.last_qrs_ind)
        rr_new = i - self.last_qrs_ind
        if rr_new < self.rr_max:
            self.rr_recent = 0.875*self.rr_recent + 0.125*rr_new

        self.qrs_inds.append(i)
        self.last_qrs_ind = i
        # Peak number corresponding to last qrs
        self.last_qrs_peak_num = self.peak_num

        # qrs recent amplitude is adjusted twice as quickly if the peak
        # was found via backsearch
        if backsearch:
            self.backsearch_qrs_inds.append(i)
            self.qrs_amp_recent = (0.75*self.qrs_amp_recent
                                   + 0.25*self.sig_i[i])
        else:
            self.qrs_amp_recent = (0.875*self.qrs_amp_recent
                                   + 0.125*self.sig_i[i])

        self.qrs_thr = max((0.25*self.qrs_amp_recent
                            + 0.75*self.noise_amp_recent), self.qrs_thr_min)

        return