def testLinear2MelMatrix(self, n_mel, n_spec): l2m = spectral_ops.linear_to_mel_weight_matrix( num_mel_bins=n_mel, num_spectrogram_bins=n_spec, sample_rate=16000, lower_edge_hertz=0.0, upper_edge_hertz=8000.0) self.assertEqual(l2m.shape, (n_spec, n_mel))
def testLinear2MelMatrix(self, n_mel, n_spec): l2m = spectral_ops.linear_to_mel_weight_matrix( num_mel_bins=n_mel, num_spectrogram_bins=n_spec, sample_rate=16000, lower_edge_hertz=0.0, upper_edge_hertz=8000.0) self.assertEqual(l2m.shape, (n_spec, n_mel))
def _linear_to_mel_matrix(self): """Get the mel transformation matrix.""" num_freq_bins = self._nfft // 2 lower_edge_hertz = 0.0 upper_edge_hertz = self._sample_rate / 2.0 num_mel_bins = num_freq_bins // self._mel_downscale return spectral_ops.linear_to_mel_weight_matrix( num_mel_bins, num_freq_bins, self._sample_rate, lower_edge_hertz, upper_edge_hertz)
def _linear_to_mel_matrix(self): """Get the mel transformation matrix.""" num_freq_bins = self._nfft // 2 lower_edge_hertz = 0.0 upper_edge_hertz = self._sample_rate / 2.0 num_mel_bins = num_freq_bins // self._mel_downscale return spectral_ops.linear_to_mel_weight_matrix( num_mel_bins, num_freq_bins, self._sample_rate, lower_edge_hertz, upper_edge_hertz)