class_docstr: Helper functions to compute specgrams.
class_docstr_tok: ["Helper","functions","to","compute","specgrams","."]
code: def _get_nfft_nhop(self):
      n_freq_bins = self._spec_shape[1]
      # Power of two only has 1 nonzero in binary representation
      is_power_2 = bin(n_freq_bins).count("1") == 1
      if not is_power_2:
          raise ValueError(
              "Wrong spec_shape. Number of frequency bins must be "
              "a power of 2, not %d" % n_freq_bins
          )
      nfft = n_freq_bins * 2
      nhop = int((1.0 - self._overlap) * nfft)
      return (nfft, nhop)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from magenta.models.gansynth.lib import spectral_ops
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling the SpecgramsHelper obj's underlying member method code with example usage: obj._get_nfft_nhop() and returns: nfft,  nhop