Waveform to spectrogram. Args: input: (batch_size, segment_samples, channels_num) Outputs: output: (batch_size, channels_num, time_steps, freq_bins)
(self, input, eps=0.)
| 113 | return sps, coss, sins |
| 114 | |
| 115 | def wav_to_spectrogram(self, input, eps=0.): |
| 116 | """Waveform to spectrogram. |
| 117 | |
| 118 | Args: |
| 119 | input: (batch_size, segment_samples, channels_num) |
| 120 | |
| 121 | Outputs: |
| 122 | output: (batch_size, channels_num, time_steps, freq_bins) |
| 123 | """ |
| 124 | sp_list = [] |
| 125 | channels_num = input.shape[1] |
| 126 | for channel in range(channels_num): |
| 127 | sp_list.append(self.spectrogram(input[:, channel, :], eps=eps)) |
| 128 | |
| 129 | output = torch.cat(sp_list, dim=1) |
| 130 | return output |
| 131 | |
| 132 | |
| 133 | def spectrogram_to_wav(self, input, spectrogram, length=None): |
nothing calls this directly
no test coverage detected