Skip to content

Instantly share code, notes, and snippets.

@Determinant
Created July 20, 2014 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Determinant/d4e725c55d1389bd4382 to your computer and use it in GitHub Desktop.
Save Determinant/d4e725c55d1389bd4382 to your computer and use it in GitHub Desktop.
Log of My Academic Life

Log of My Academic Life

Sun Jul 20

  • kaldi
    • 完成kaldi动态链接
    • 几经周折后,在小集群上重现
    • 发现kaldi官网发生变化,去除了stable,推荐trunk(似乎修正了stable很多bug,以及增加动态链接支持)
  • HTK
    • HTK configure中看出 在x64下是用-m32编译的,所以需要链接的也是32位库,因此小集群上的x11 library无法使用,故需要 ./configure —without-x —disable-hslab 方可正常编译
    • HTK make时应-j1,由于makefile设计上或者其他问题,-j4会导致race condition使得在编译某个文件时依赖的静态库还没编译完
  • 从无到有地实现了一个短时傅里叶频谱分析器:https://gist.github.com/Determinant/86afaa9b54f0528d4a93
    • 用C实现
    • 为了避免直接parse音频文件(其实对于WAV格式来说也不难,但是WAV规范有些变体,这就很讨厌),采用一个被广泛使用的库:libsndfile,可以直接从无损音频格式中读取samples,每个声道是一个short (16bits)。
    • 其余部分均为自己实现,FFT直接用了上次手写的FFT,虽然是最简单的那种算法,但是作了一些常数优化后效果不错。
    • 支持的参数有:

      Simple Spec -- A Simple Discrete-time STFT Program.
      
      Usage: simple_spec [OPTION]... [FILE]
      
        -w, --win             window function: rect, hann, hamming
        -b, --bin             the width of a window
        -d, --delta           the shift of a window
        --raw                 read raw PCM16 data
        -f, --freq            the frequency used in resampling
        -a, --amp             the way of calculating amplitude: linear, decibel, norm, dtmf
        -h, --help            show this info
    • 对人声(王菲的两首歌曲),乐器(吉他:Romance d’Amour,小提琴:Schindler's List 和钢琴:Humoresque)音频进行了分析,效果不错。(有图有真相)
  • 在俞老师的建议下,实现了简单的DTMF拨号音识别(2s内拨完的11位手机号能正确识别)。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment