def transform_spec_from_raw(raw):
'''
Read raw features from TFRecords and shape them into spectrograms
'''
spec = tf.decode_raw(raw, tf.float32)
spec.set_shape([Config.num_time_frames * Config.num_freq_bins * 2])
spec = tf.reshape(spec, [-1, Config.num_freq_bins * 2])
real, imag = tf.split(spec, [Config.num_freq_bins, Config.num_freq_bins], axis=1)
orig_spec = tf.complex(real, imag)
return orig_spec # [num_time_frames, num_freq_bin]
评论列表
文章目录