读取串口数据,将数据傅里叶变换(FFT)后实时显示频谱图(python)
读取串口并将数据添加到定义的变量中,该变量经过 FFT 并显示实时更新的图。from pyqtgraph.Qt import QtGui, QtCoreimport numpy as npimport pyqtgraph as pgfrom pyqtgraph.ptime import timeimport serialimport timefrom scipy import fftpackglobal data_displayapp = QtGui.QApplication([])