MCPcopy
hub / github.com/Audio-AGI/AudioSep / wav_to_spectrogram

Method wav_to_spectrogram

models/base.py:115–130  ·  view source on GitHub ↗

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.)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 2

spectrogramMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected