def _myfft_gc_skew(self, M): """ x : GC_skew vector (list) param N: length of the GC skew vector param M: length of the template param A: amplitude between positive and negative GC skew vector """ x = self._GC_skew_slide[0] N = len(x) template = self._create_template_fft(M) + [0] * (N - M) template /= pylab.norm(template) print("1") c = np.fft.fft(x) print("1bis") c = abs( np.fft.ifft(np.fft.fft(x) * pylab.conj(np.fft.fft(template)))** 2) / pylab.norm(x) / pylab.norm(template) print("2") # shift the SNR vector by the template length so that the peak is at the END of the template c = np.roll(c, M // 2) print("3") self._template_fft = template self._c_fft = c * 2. / N
def _myfft_gc_skew(self, M): """ x : GC_skew vector (list) param N: length of the GC skew vector param M: length of the template param A: amplitude between positive and negative GC skew vector """ x = self._GC_skew_slide[0] N = len(x) template = self._create_template_fft(M) + [0] * (N-M) template/=pylab.norm(template) c = np.fft.fft(x) c = abs(np.fft.ifft( np.fft.fft(x) * pylab.conj(np.fft.fft(template)) )**2)/pylab.norm(x)/pylab.norm(template) # shift the SNR vector by the template length so that the peak is at the END of the template c = np.roll(c, M//2) self._template_fft = template self._c_fft = c*2./N