Cutting of unused frequencies in specgram matplotlib

后端 未结 4 2109
醉话见心
醉话见心 2021-02-06 05:04

I have a signal with sampling rate 16e3, its frequency range is from 125 to 1000 Hz. So if i plot a specgram i get a pretty small colorrange because of all the unused frequencys

4条回答
  •  庸人自扰
    2021-02-06 05:42

    These days, there's an easier way to do this than when the question was asked: you can use matplotlib.pyplot.axis to set ymin and ymax to your desired frequencies. It's quite easy; here's a snippet from my program:

    plt.specgram(xmit, NFFT=65536, Fs=Fs)
    plt.axis(ymin=Fc-Fa*10, ymax=Fc+Fa*10)
    plt.show()
    

提交回复
热议问题