$ show AllenDowney/ThinkDSP
This repository is the companion to Allen Downey's Think DSP book. It is primarily an educational Python library plus a collection of Jupyter notebooks, not a production service or a research data pipeline. The core deliverable is the `thinkdsp` package, a self-contained module that provides object-oriented primitives for representing periodic signals (`Signal`, `Sinusoid`, `Chirp`, `Noise`), sampling them into `Wave` objects, and transforming between time and frequency domains via FFT and DCT. The library also supports spectral arithmetic, filtering, convolution, autocorrelation, spectrogram generation, WAV file I/O, and basic audio synthesis. The notebooks in `nb/`, `split/`, and `examples/` walk through each chapter of the book, with solution notebooks and standalone solution scripts in `soln/`.
The LLM identified 2 files worth highlighting for reuse:
The core library, implemented as a single self-contained module. It defines a clean class hierarchy of Signal subclasses, Wave/Spectrum conversion methods, filtering and convolution utilities, DCT, spectrograms, and WAV I/O. It imports only external scientific packages (numpy, scipy, matplotlib), has no internal project coupling, and can be packaged or dropped into another project for teaching or lightweight audio analysis.
A solution script implementing the Discrete Fourier Transform and its inverse directly from the synthesis matrix, with comparison against numpy's FFT. The core `dft`/`idft` functions are self-contained and express the mathematical definition of the DFT clearly, making them reusable as reference implementations for validating FFT routines or for teaching the relationship between the DFT and the FFT.