Python で音響信号処理 spectrum.py
2016-07-16 Takuya Nishimoto (@24motz)
広島版IoT縛りの勉強会! IoTLT広島 vol.2
$ sudo apt-get install portaudio19-dev python-dev
$ curl https://bootstrap.pypa.io/get-pip.py | sudo python
$ sudo pip install pyaudio
$ sudo pip install numpy
- Raspberry Pi 3 (Raspbian) で USB Audio Interface を接続、マイクをつなぐ
- python spectrum.py を実行
- オーディオミキサーで入力ゲインを調節
DragonBoard 410c (Debian) でも動作確認している。
スペクトルの表示
- 濃淡をそれっぽく変更
FFTケプストラムの表示
- callback() の self.fft(data) を self.cepstrum(data) に変更。
PIP
ケプストラム分析
- ケプストラム (ウィキペディア)
- Cepstrum (Wikipedia)
- ケプストラムって要するに何ですか? from 音響学入門ペディア
PyAudio
numpy fromstring
numpy fft