def _search_minimum_distance(self, ref, buff):
if len(ref) < self.fl:
ref = np.r_[ref, np.zeros(self.fl - len(ref))]
# slicing and windowing one sample by one
buffmat = view_as_windows(buff, self.fl) * self.win
refwin = np.array(ref * self.win).reshape(1, self.fl)
corr = correlate2d(buffmat, refwin, mode='valid')
return np.argmax(corr) - self.sl
评论列表
文章目录