code: def sqd_yinfft(samples):
      """compute yinfft modified sum of squared differences
  
      Very fast, improved performance in transients.
  
      FIXME: biased."""
      B = len(samples)
      W = B // 2
      yin = np.zeros(W)
  
      def hanningz(W):
          return 0.5 * (1.0 - np.cos(2.0 * np.pi * np.arange(W) / W))
  
      # win = np.ones(B)
      win = hanningz(B)
      sqrmag = np.zeros(B)
      fftout = np.fft.fft(win * samples)
      sqrmag[0] = fftout[0].real ** 2
      for l in range(1, W):
          sqrmag[l] = fftout[l].real ** 2 + fftout[l].imag ** 2
          sqrmag[B - l] = sqrmag[l]
      sqrmag[W] = fftout[W].real ** 2
      fftout = np.fft.fft(sqrmag)
      sqrsum = 2.0 * sqrmag[: W + 1].sum()
      yin[0] = 0
      yin[1:] = sqrsum - fftout.real[1:W]
      return yin / B
  
file_path: aubio/python/demos/demo_yin_compare.py
imports: import sys
  import numpy
  import matplotlib.pyplot
label_desc: Use image node_id 4 for calling a global function with example usage: sqd_yinfft(samples) and returns: unknown, unknown