Getting Started with Signal Processing in Python: Visualizing Sound with Spectrograms

wat
Sound is invisible, but Python can help us see it. This talk introduces audio signal processing by visualizing sound as waveforms, frequency spectra, and spectrograms. It is designed for Python users who are curious about audio analysis but new to signal processing.
Starting from digital audio basics such as sampling rate, bit depth, and frame-based processing, the talk explains FFT and time-frequency analysis through practical examples. The focus is spectrograms, which show how frequencies change over time.
This version is based on publicly available code from my PyCon JP 2025 session. The demo follows a reproducible end-to-end workflow using .py files on GitHub: loading audio, visualizing waveforms, computing spectra, generating spectrograms, adjusting key parameters, and interpreting the results. Along the way, it highlights implementation choices, common beginner mistakes, and parameter trade-offs. No deep mathematical background is required; basic Python knowledge is enough.
Description
This talk introduces audio signal processing with Python through practical visualization examples. Signal processing can look difficult at first, but sound is a familiar and intuitive subject. By using waveforms, frequency spectra, and spectrograms, attendees can understand how Python can be used to “see” sound.
The talk is based on a session I presented at PyCon JP 2025, updated and adapted for an international audience. It focuses on intuition and practical Python code rather than heavy mathematics. The goal is to help attendees start writing their own simple audio analysis programs after the session.
The talk will cover:
- Why Python is useful for signal processing
- Basic concepts of digital audio: sampling rate, bit depth, and frames
- Recording or loading audio data with Python
- Visualizing time-domain waveforms
- Understanding FFT and frequency spectra
- Creating spectrograms and understanding time-frequency analysis
- How frame size and overlap affect time/frequency resolution
- Examples using speech, music, noise, and mechanical sounds
- Possible applications in audio analysis, vibration analysis, and machine learning
The main demo will show how a real-world sound changes from raw audio data into a waveform, a frequency spectrum, and finally a spectrogram. I will also show examples where different sounds become visually distinguishable through spectrograms. This helps attendees understand that signal processing is not only a mathematical technique, but also a practical and enjoyable way to explore real-world data.

Wat is a mechanical engineer and Python technical writer based in Japan. He is the author of a Python programming book published in Japan and writes WATLAB, a technical blog focused on practical Python applications. He works as an engineer in the Japanese manufacturing industry, specializing in mechanical engineering, product noise and vibration, experiments, and CAE analysis. He uses Python for signal processing, data analysis, visualization, and engineering automation.