# allendowney/thinkdsp architecture

> Architecture diagram of the GitHub repository allendowney/thinkdsp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/allendowney/thinkdsp
- Repository: https://github.com/allendowney/thinkdsp

## Overview

ThinkDSP is both an educational DSP book and a Python signal-processing library. The main workflow is a learner running a chapter notebook, using ThinkDSP to create or read signals and analyze them, then viewing plots or audio results. The graph also preserves the book, chapter examples, and supporting analysis utilities. Source excerpts show several example-to-library and plotting calls; other chapter capabilities are documented but not fully sampled, so their internal links are omitted.

Main entry points: [`nb/thinkdsp.py`](https://github.com/allendowney/thinkdsp/blob/master/nb/thinkdsp.py) (Notebook DSP core), [`soln/thinkplot.py`](https://github.com/allendowney/thinkdsp/blob/master/soln/thinkplot.py) (Plotting utilities), [`soln/noise.py`](https://github.com/allendowney/thinkdsp/blob/master/soln/noise.py) (Noise examples), [`nb`](https://github.com/allendowney/thinkdsp/tree/master/nb) (Chapter notebooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning materials"]
  node_chapters["Chapter notebooks"]
  node_book["First edition book<br/>[book.tex]"]
end

subgraph group_runtime["DSP library"]
  node_notebook_dsp["Notebook DSP core<br/>[thinkdsp.py]"]
  node_package_dsp["ThinkDSP package<br/>[thinkdsp.py]"]
  node_exports["Public exports<br/>[__init__.py]"]
end

subgraph group_examples["DSP examples"]
  node_sampling["Sampling examples<br/>[sampling.py]"]
  node_convolution["Convolution examples<br/>[convolution.py]"]
  node_transforms["Transform examples<br/>[dft.py]"]
  node_dct["DCT examples<br/>[dct.py]"]
  node_chirp["Chirp and windows<br/>[chirp.py]"]
  node_diff_int["Differentiation and integration<br/>[diff_int.py]"]
  node_noise["Noise examples<br/>[noise.py]"]
end

subgraph group_analysis["Analysis utilities"]
  node_plotting["Plotting utilities<br/>[thinkplot.py]"]
  node_statistics["Statistical utilities<br/>[thinkstats2.py]"]
end

node_learner(("Learner"))

node_learner -->|"runs"| node_chapters
node_chapters -->|"uses DSP"| node_notebook_dsp
node_chapters -.->|"follows chapters"| node_book
node_notebook_dsp -.->|"creates results"| node_learner
node_exports -->|"exports API"| node_package_dsp
node_sampling -->|"uses signals"| node_notebook_dsp
node_sampling -->|"plots results"| node_plotting
node_convolution -->|"uses signals"| node_notebook_dsp
node_convolution -->|"plots results"| node_plotting
node_transforms -->|"synthesizes signals"| node_notebook_dsp
node_transforms -->|"plots results"| node_plotting
node_dct -->|"analyzes waves"| node_notebook_dsp
node_dct -->|"plots results"| node_plotting
node_chirp -->|"analyzes waves"| node_notebook_dsp
node_chirp -->|"plots results"| node_plotting
node_diff_int -->|"processes waves"| node_notebook_dsp
node_diff_int -->|"plots results"| node_plotting
node_noise -->|"generates noise"| node_notebook_dsp
node_noise -->|"plots results"| node_plotting
node_noise -->|"uses distributions"| node_statistics

click node_chapters "https://github.com/allendowney/thinkdsp/tree/master/nb"
click node_book "https://github.com/allendowney/thinkdsp/blob/master/book/book.tex"
click node_notebook_dsp "https://github.com/allendowney/thinkdsp/blob/master/nb/thinkdsp.py"
click node_package_dsp "https://github.com/allendowney/thinkdsp/blob/master/thinkdsp/thinkdsp.py"
click node_exports "https://github.com/allendowney/thinkdsp/blob/master/thinkdsp/__init__.py"
click node_sampling "https://github.com/allendowney/thinkdsp/blob/master/soln/sampling.py"
click node_convolution "https://github.com/allendowney/thinkdsp/blob/master/soln/convolution.py"
click node_transforms "https://github.com/allendowney/thinkdsp/blob/master/soln/dft.py"
click node_dct "https://github.com/allendowney/thinkdsp/blob/master/soln/dct.py"
click node_chirp "https://github.com/allendowney/thinkdsp/blob/master/soln/chirp.py"
click node_diff_int "https://github.com/allendowney/thinkdsp/blob/master/soln/diff_int.py"
click node_noise "https://github.com/allendowney/thinkdsp/blob/master/soln/noise.py"
click node_plotting "https://github.com/allendowney/thinkdsp/blob/master/soln/thinkplot.py"
click node_statistics "https://github.com/allendowney/thinkdsp/blob/master/soln/thinkstats2.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_chapters,node_book toneBlue
class node_notebook_dsp,node_package_dsp,node_exports toneAmber
class node_sampling,node_convolution,node_transforms,node_dct,node_chirp,node_diff_int,node_noise toneMint
class node_plotting,node_statistics toneRose
class node_learner toneIndigo
```

## Components

### Learning materials

- [Chapter notebooks](https://github.com/allendowney/thinkdsp/tree/master/nb): `nb`
- [First edition book](https://github.com/allendowney/thinkdsp/blob/master/book/book.tex): `book/book.tex`

### DSP library

- [Notebook DSP core](https://github.com/allendowney/thinkdsp/blob/master/nb/thinkdsp.py): `nb/thinkdsp.py`
- [ThinkDSP package](https://github.com/allendowney/thinkdsp/blob/master/thinkdsp/thinkdsp.py): `thinkdsp/thinkdsp.py`
- [Public exports](https://github.com/allendowney/thinkdsp/blob/master/thinkdsp/__init__.py): `thinkdsp/__init__.py`

### DSP examples

- [Sampling examples](https://github.com/allendowney/thinkdsp/blob/master/soln/sampling.py): `soln/sampling.py`
- [Convolution examples](https://github.com/allendowney/thinkdsp/blob/master/soln/convolution.py): `soln/convolution.py`
- [Transform examples](https://github.com/allendowney/thinkdsp/blob/master/soln/dft.py): `soln/dft.py`
- [DCT examples](https://github.com/allendowney/thinkdsp/blob/master/soln/dct.py): `soln/dct.py`
- [Chirp and windows](https://github.com/allendowney/thinkdsp/blob/master/soln/chirp.py): `soln/chirp.py`
- [Differentiation and integration](https://github.com/allendowney/thinkdsp/blob/master/soln/diff_int.py): `soln/diff_int.py`
- [Noise examples](https://github.com/allendowney/thinkdsp/blob/master/soln/noise.py): `soln/noise.py`

### Analysis utilities

- [Plotting utilities](https://github.com/allendowney/thinkdsp/blob/master/soln/thinkplot.py): `soln/thinkplot.py`
- [Statistical utilities](https://github.com/allendowney/thinkdsp/blob/master/soln/thinkstats2.py): `soln/thinkstats2.py`

### Other components

- **Learner**

## Connections

- Learner → Chapter notebooks: runs (evidence: `README.md`)
- Chapter notebooks → Notebook DSP core: uses DSP (evidence: `README.md`)
- Chapter notebooks → First edition book: follows chapters
- Notebook DSP core → Learner: creates results
- Public exports → ThinkDSP package: exports API (evidence: `thinkdsp/__init__.py`)
- Sampling examples → Notebook DSP core: uses signals (evidence: `soln/sampling.py`)
- Sampling examples → Plotting utilities: plots results (evidence: `soln/sampling.py`)
- Convolution examples → Notebook DSP core: uses signals (evidence: `soln/convolution.py`)
- Convolution examples → Plotting utilities: plots results (evidence: `soln/convolution.py`)
- Transform examples → Notebook DSP core: synthesizes signals (evidence: `soln/dft.py`)
- Transform examples → Plotting utilities: plots results (evidence: `soln/dft.py`)
- DCT examples → Notebook DSP core: analyzes waves (evidence: `soln/dct.py`)
- DCT examples → Plotting utilities: plots results (evidence: `soln/dct.py`)
- Chirp and windows → Notebook DSP core: analyzes waves (evidence: `soln/chirp.py`)
- Chirp and windows → Plotting utilities: plots results (evidence: `soln/chirp.py`)
- Differentiation and integration → Notebook DSP core: processes waves (evidence: `soln/diff_int.py`)
- Differentiation and integration → Plotting utilities: plots results (evidence: `soln/diff_int.py`)
- Noise examples → Notebook DSP core: generates noise (evidence: `soln/noise.py`)
- Noise examples → Plotting utilities: plots results (evidence: `soln/noise.py`)
- Noise examples → Statistical utilities: uses distributions (evidence: `soln/noise.py`)
