visual.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Spherical-robot 作者: Evan-Zhao 项目源码 文件源码
def make_fft_graph(fft, corre):
    fft_np = numpy.array(fft).swapaxes(0, 1).swapaxes(1, 2)
    channel_N, freq_N, sample_N = fft_np.shape
    if (channel_N > 6):  # We don't have space for more than 6 channels
        return
    fig, axes = plt.subplots(2, 3)
    fig.subplots_adjust(hspace=0.3, wspace=0.05)
    for ax, mat, i in zip(axes.flat, fft_np, range(1, channel_N + 1)):
        fft_abs = numpy.abs(mat)
        fft_less_row = fft_abs[0::20]
        n = freq_N / 20
        fft_sqr = numpy.repeat(fft_less_row, int(n / sample_N)).reshape([n, n])
        ax.matshow(fft_sqr, cmap='viridis')
        plt.xlabel('time')
        plt.ylabel('freq')
        ax.set_title('Channel {0}'.format(i))
    plt.show()
    print("Plotted.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号