zoukankan      html  css  js  c++  java
  • python 工具 FFT变换

    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()

  • 相关阅读:
    List集合
    ArrayList_toArray
    Collection集合基础知识
    Array类的使用
    16.10
    16.9
    16.8
    16.7
    16.6
    16.5
  • 原文地址:https://www.cnblogs.com/dzzy/p/9082859.html
Copyright © 2011-2022 走看看