
Audio Spectrum Analyser: an FFT Program for the Sound Card
A short Python program that turns a computer's sound input into a spectrum analyser: it takes a block of samples, windows it, runs an FFT and plots the level of every frequency in dB. It reads a sine's amplitude and frequency, shows harmonics and noise, and also works on WAV files.
初心者
30 minutes
手順
1
1
What the FFT reads
What the FFT reads
Jupyter ノートブックを読み込み中…
2
2
The program
The program
Install Python 3 with numpy, matplotlib and sounddevice, save this as spectrum.py and run it.
spectrum.pypython
必要な工具:
デスクトップパソコン3
3
Measure a signal
Measure a signal
Feed the signal into the line input with an audio cable and run python3 spectrum.py: it prints the bin width and the strongest peak and plots the spectrum. If the peak reads near 0 dBFS the input is clipping: turn the signal down. A clean sine shows one peak; harmonics show at 2x, 3x its frequency. The sound card only sees up to half its sample rate, 24 kHz at 48 kHz.
必要な工具:
デスクトップパソコン
オーディオケーブル元にした設計図:以前の設計図の材料
この設計図で作るもの
CC0 パブリックドメイン
この設計図はCC0で公開されています。許可を求めずに、自由にコピー、修正、配布、あらゆる目的で使用できます。
メイカーを応援するには、設計図経由で製品を購入してください。メイカーには メイカーコミッション がベンダーにより設定されています。または、この設計図の新しいイテレーションを作成し、自分の設計図にコネクションとして含めて収益を共有できます。

