'Keep a buffer of the running data and process it to determine if there is
a peak.'

def _updateBuffer(self, v):

    self._rtData.append(v)
    wndwCenter = int(np.floor((self._window / 2.0)))
    if (len(self._rtData) > self._window):
        self._rtData = self._rtData[1:]
        if self._isPeak:
            lm = self._rtData.findPeaks()
            for l in lm:
                if ((l[0] == wndwCenter) and (l[1] > self._cutoff)):
                    if self.doCorr:
                        corrVal = np.correlate(self._rtData.normalize(), self._template)
                        thresh = (self.corrThresh[0] - (self.corrStdMult * self.corrThresh[1]))
                        if (corrVal[0] > thresh):
                            self.count += 1
                    else:
                        self.count += 1
        else:
            lm = self._rtData.findValleys()
            for l in lm:
                if ((l[0] == wndwCenter) and (l[1] < self._cutoff)):
                    if self.doCorr:
                        corrVal = np.correlate(self._rtData.normalize(), self._template)
                        thresh = (self.corrThresh[0] - (self.corrStdMult * self.corrThresh[1]))
                        if (corrVal[0] > thresh):
                            self.count += 1
                    else:
                        self.count += 1
    return self.count
