import numpy as np
import pylab
wave_data =np.fromfile("C:\\Users\\Administrator\\Desktop\\bins\\4.b_le.bin", dtype=np.int16 , count=21220 )
wave_data.shape = -1,2
wave_data = wave_data.T
N=88200
start=0 #开始采样位置
df = 1000/(N-1) # 分辨率
freq = [df*n for n in range(0,N)] #N个元素
wave_data2=wave_data[0][start:start+N]
c=np.fft.fft(wave_data2)*2/N
#常规显示采样频率一半的频谱
d=int(len(c)/2)
pylab.plot(freq[:d-1],abs(c[:d-1]),'r')
pylab.show()

 

相关文章:

  • 2021-04-07
  • 2022-01-31
  • 2021-12-01
  • 2021-11-18
  • 2021-11-18
  • 2021-12-10
  • 2021-11-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2021-05-31
  • 2021-06-17
相关资源
相似解决方案