【发布时间】:2020-05-31 22:54:43
【问题描述】:
我正在使用keras 并且拥有:
corrupted_samples, corrupted_sample_rate = sf.read(
self.corrupted_audio_file_paths[index])
frequencies, times, spectrogram = scipy.signal.spectrogram(
corrupted_samples, corrupted_sample_rate)
根据the docs,这给出了:
f (ndarray) - Array of sample frequencies.
t (ndarray) - Array of segment times.
Sxx (ndarray) - Spectrogram of x. By default, the last axis of Sxx corresponds to the segment times.
我假设所有时间都会排队,所以我不在乎时间的价值(我不这么认为)。 frequencies 也是如此。所以我真正需要的是每个频率在每个时间的值,由我的代码中的Sxx(或spectrogram)给出。我不确定如何实际做到这一点。不过看起来很简单。
【问题讨论】:
-
Sxx是一个 numpy 数组。看起来你的问题是how to convert a numpy array to keras tensor。
标签: python numpy keras scipy tensor