An idiomatic Julia toolkit for signals, waves, spectra, filtering, and audio, inspired by Allen Downey's Think DSP.
ThinkDSP.jl targets Julia 1.12+ and is currently prepared for its first public release.
- Signal families: sinusoids, periodic waves, chirps, impulses, and colored noise.
- Time-domain processing: sampled
Wavevalues, arithmetic, windows, segmentation, convolution, differentiation, and integration. - Frequency-domain analysis: FFT spectra, DCTs, filters, spectral calculus, and reusable FFTW workspaces.
- Time-frequency analysis: STFT spectrograms with normalized overlap-add reconstruction.
- Audio and music helpers: WAV I/O, PCM quantization, MIDI notes, chords, and rests.
- Plotting recipes for signals, waves, spectra, DCTs, integrated spectra, and
spectrograms through
RecipesBase.
ThinkDSP.jl has not yet been registered. Install it from a local checkout:
using Pkg
Pkg.develop(path="/path/to/think_dsp_julia_build")After registration, installation will be:
using Pkg
Pkg.add("ThinkDSP")using ThinkDSP
signal = Sinusoid(440.0)
wave = make_wave(signal; duration=1.0, framerate=44100)
spec = spectrum(wave)
println("Peak frequency: ", spec.fs[argmax(magnitude(spec))], " Hz")ThinkDSP uses RecipesBase. Load Plots separately:
using Plots
gr()
plot(wave)
plot(spec; representation=:magnitude)
plot(spectrogram(wave))The source documentation is in docs/src. Build the site locally with:
julia --project=docs docs/make.jlThe generated site is written to docs/build/ and is not committed.
The examples/ directory contains small executable programs as well as
end-to-end workflows:
| Example | Demonstrates |
|---|---|
basic_fft.jl |
FFT spectrum and inverse-transform round trip |
signal_pipeline.jl |
Two-tone analysis, low-pass filtering, differentiation, and convolution |
reusable_workspaces.jl |
Reusing FFT, DCT, and spectrogram workspaces |
audio_midi_roundtrip.jl |
MIDI chord construction and 16-bit WAV round trip |
plotting.jl |
RecipesBase integration with Plots.jl |
Run a non-plotting example from the repository root:
julia --project=. examples/signal_pipeline.jlThe plotting example requires the contributor environment:
julia --project=dev examples/plotting.jlClone the repository, then instantiate the root workspace once:
using Pkg
Pkg.activate(".")
Pkg.instantiate()
Pkg.test()ThinkDSP uses Julia 1.12+ workspaces. Package users receive only the runtime
dependencies in the root Project.toml; contributor tools are scoped to
dedicated projects that share the root Manifest.toml.
| Workspace | Purpose |
|---|---|
dev |
Daemon workflow, Revise, plotting, validation, and local tooling |
test |
Functional tests plus Aqua and JET quality checks |
benchmark |
BenchmarkTools and the checked-in benchmark baseline |
docs |
Documenter-based site build |
Start the optional development daemon with:
julia --project=dev --startup-file=no -t auto -e 'using Revise, DaemonMode; serve(async=true)'Run a command through the daemon with the same environment:
julia --project=dev --startup-file=no -e 'using DaemonMode; runargs()' validation/run_daemon.jljulia --project=. -e 'using Pkg; Pkg.test()'
julia --project=test test/qa.jljulia --project=benchmark benchmark/benchmarks.jl --check-baselinejulia --project=dev --startup-file=no -e 'using DaemonMode; runargs()' validation/run_daemon.jl
python3 validation/python_reference.py validation/artifacts/latest
julia --project=dev validation/check.jl validation/artifacts/latestValidation artifacts are local-only and ignored by Git. Run validation and benchmark commands serially when using DaemonMode because its redirected output is process-global.
ThinkDSP.jl is released under the MIT License. It is a Julia port
inspired by Allen Downey's Think DSP and the associated thinkdsp.py
implementation. See docs/PORTING.md for intentional
behavioral differences.