(wav_audio, hparams)
return cqt
Transforms the contents of a wav file into a series of CQT frames.
Transforms the contents of a wav file into a series of CQT frames.
Transforms the contents of a wav file into a series of CQT frames .
def _wav_to_cqt(wav_audio, hparams):
  """Transforms the contents of a wav file into a series of CQT frames."""
  y = audio_io.wav_data_to_samples(wav_audio, hparams.sample_rate)

  cqt = np.abs(
      librosa.core.cqt(
          y,
          hparams.sample_rate,
          hop_length=hparams.spec_hop_length,
          fmin=hparams.spec_fmin,
          n_bins=hparams.spec_n_bins,
          bins_per_octave=hparams.cqt_bins_per_octave),
      dtype=np.float32)

  # Transpose so that the data is in [frame, bins] format.
  cqt = cqt.T
  return cqt
def _wav_to_cqt ( wav_audio , hparams ) : y = audio_io . wav_data_to_samples ( wav_audio , hparams . sample_rate ) cqt = np . abs ( librosa . core . cqt ( y , hparams . sample_rate , hop_length = hparams . spec_hop_length , fmin = hparams . spec_fmin , n_bins = hparams . spec_n_bins , bins_per_octave = hparams . cqt_bins_per_octave ) , dtype = np . float32 ) # Transpose so that the data is in [frame, bins] format. cqt = cqt . T return cqt