def two_plot_time_freq_mag(self, minlen=10):
part = [pp for pp in self.partial if len(pp.f) > minlen]
pl.figure()
ax1 = pl.subplot(211)
pl.hold(True)
ax2 = pl.subplot(212, sharex=ax1)
pl.hold(True)
for pp in part:
ax1.plot(pp.start_idx + np.arange(len(pp.f)), np.array(pp.f))
ax2.plot(pp.start_idx + np.arange(len(pp.f)),
20*np.log10(np.array(pp.mag)))
ax1.hold(False)
# ax1.xlabel('Time (s)')
ax1.set_ylabel('Frequency (Hz)')
ax2.set_xlabel('Time (s)')
ax2.set_ylabel('Frequency (Hz)')
# pl.show()
return pl.gca()
评论列表
文章目录