
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.
Principiante
30 minutes
Istruzioni
1
1
What the FFT reads
What the FFT reads
Caricamento del notebook 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
Strumenti necessari:
Computer da tavolo3
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.
Strumenti necessari:
Computer da tavolo
Cavo audioStrumenti richiesti
2- Segnaposto
- 1 vendor sell this, none ship to you yetSegnaposto
Si basa su: materiali da progetti precedenti
Questo progetto realizza
CC0 Pubblico dominio
Questo progetto è rilasciato sotto CC0. Sei libero di copiare, modificare, distribuire e utilizzare quest'opera per qualsiasi scopo, senza chiedere permesso.
Supporta il Maker acquistando prodotti tramite il suo progetto dove guadagna una Commissione Maker stabilita dai venditori, oppure crea una nuova iterazione di questo progetto e includilo come collegamento nel tuo progetto per condividere i ricavi.

