hmmc.py 文件源码

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

项目:lazyprogrammer 作者: inhwane 项目源码 文件源码
def real_signal():
    spf = wave.open('helloworld.wav', 'r')

    #Extract Raw Audio from Wav File
    # If you right-click on the file and go to "Get Info", you can see:
    # sampling rate = 16000 Hz
    # bits per sample = 16
    # The first is quantization in time
    # The second is quantization in amplitude
    # We also do this for images!
    # 2^16 = 65536 is how many different sound levels we have
    signal = spf.readframes(-1)
    signal = np.fromstring(signal, 'Int16')
    T = len(signal)

    hmm = HMM(10)
    hmm.fit(signal.reshape(1, T))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号