Skip to content

Repository files navigation

Signals: Applied Signal Processing & ML Notebooks

CIPython 3.12License: MITTextbook: Physical Computing

Hands-on Jupyter notebooks for applied signal processing and time-series classification in human–computer interaction and ubiquitous computing — covering sampling and quantization, comparing signals in the time domain, frequency analysis (DFT/FFT/STFT), and two complete accelerometer projects (step tracking and gesture recognition).

📖 These notebooks power the Signals module of the Physical Computing interactive textbook. Read the rendered lessons in the textbook — textbook home · textbook source. This repository is the source of truth where the notebooks are maintained, mirroring how the textbook treats makeabilitylab/arduino.

Developed for, and refined across several offerings of, a graduate ubiquitous-computing course at the University of Washington.

Lessons

Run the notebooks in this order — each builds on the previous one. Launch in the cloud (no install) with the badges, or run locally (see Setup).

#LessonNotebookCloud
1Intro to PythonTutorials/IntroToPython.ipynbOpen In ColabBinder
2Intro to NumPyTutorials/IntroToNumPy.ipynbOpen In ColabBinder
3Intro to MatplotlibTutorials/IntroToMatplotlib.ipynbOpen In ColabBinder
4Quantization & SamplingTutorials/Signals - Quantization and Sampling.ipynbOpen In ColabBinder
5Comparing Signals (time domain)Tutorials/Signals - Comparing Signals.ipynbOpen In ColabBinder
6Frequency Analysis (DFT/FFT/STFT)Tutorials/Signals - Frequency Analysis.ipynbOpen In ColabBinder
7Step TrackerProjects/StepTracker/StepTracker-Exercises.ipynbOpen In ColabBinder
8Gesture Recognition: Shape-BasedProjects/GestureRecognizer/GestureRecognizer-ShapeBased.ipynbOpen In ColabBinder
9Gesture Recognition: Feature-BasedProjects/GestureRecognizer/GestureRecognizer-FeatureBased.ipynbOpen In ColabBinder
10Feature Selection & Hyperparameter TuningProjects/GestureRecognizer/Feature Selection and Hyperparameter Tuning.ipynbOpen In ColabBinder

Note: the Colab badges load a notebook directly from GitHub but do not clone the repo's data or helper packages. A small "Colab setup" bootstrap cell (added per notebook in the lesson-modernization pass) handles that. Binder builds a full environment from environment.yml/requirements.txt and checks out the whole repo, so data and imports work there without extra steps.

Who this is for & how to use

Students / self-learners. Work through the lessons in order (cloud badges above, or run locally). Each notebook keeps its exercise prompts and "your turn" cells and shows a worked ### Example solution right below them — so you can attempt each exercise first, then check your approach against a model answer.

Instructors. The notebooks are complete, runnable teaching artifacts you can lecture from directly. The original student-template TODOs are now answered inline (see #6); planning fresh graded work is tracked in #28. Instructor-only answer keys (*-Private.ipynb) remain unpublished (gitignored).

Setup

Requires Python 3.12. Two supported paths — pick one.

Option A — venv + pip (no conda needed)

git clone https://github.com/makeabilitylab/signals.git
cd signals
python -m venv .venv
.venv/Scripts/activate # Windows# source .venv/bin/activate # macOS / Linux
pip install -r requirements.txt
jupyter lab

Option B — conda

git clone https://github.com/makeabilitylab/signals.git
cd signals
conda env create -f environment.yml
conda activate signals
jupyter lab

Both paths also install the local helper packages (makelab, gesturerec) in editable mode via pip install -e ., so the notebooks import them from anywhere with no sys.path hacks:

importmakelab.signal# used by the Tutorials notebooksimportgesturerec.data# used by the GestureRecognizer notebooks

Tests

The helper packages have unit tests and the notebooks have headless "does it still execute" smoke tests. None of this lives inside the notebooks. Install the test extras and run:

pip install -e ".[test]"
pytest tests/ # fast unit tests for makelab + gesturerec
pytest --nbmake Tutorials/ Projects/StepTracker/ # execute the fast notebooks
pytest --nbmake Projects/GestureRecognizer/ # execute the (slow) gesture notebooks

nbmake executes each notebook in its own directory and fails on any uncaught error (intentional teaching errors are tagged raises-exception and allowed). CI runs the unit tests + fast notebooks on every push/PR, and the slow gesture notebooks only when a change touches them (plus a monthly canary and on-demand) — see .github/workflows/.

Repository layout

.
├── Tutorials/ # Lessons 1–6 (Python/NumPy/Matplotlib + signals)
│ ├── makelab/ # shared signal + audio helpers (importable package)
│ └── data/audio/ # audio clips used by Quantization & Sampling
├── Projects/
│ ├── StepTracker/ # Lesson 7 (+ Logs/ accelerometer step data)
│ └── GestureRecognizer/ # Lessons 8–10
│ ├── gesturerec/ # data structures + experiment scaffolding (package)
│ ├── GestureLogs/ # per-participant gesture training data
│ └── ADXL335GestureLogs/ # alternate-sensor gesture data
├── tests/ # pytest unit tests for makelab + gesturerec
├── .github/workflows/ # CI: unit + notebook smoke tests
├── pyproject.toml # packaging for makelab + gesturerec
├── requirements.txt # pinned pip environment
└── environment.yml # pinned conda environment

The notebooks are complete teaching artifacts: each keeps its exercise prompts and "your turn" cells and adds a labeled ### Example solution with worked code right below (see #6). Instructor-only answer keys (*-Private.ipynb) are intentionally not published.

Contributing

Bug reports, fixes, and improvements are welcome — please open an issue or pull request. Run the tests before submitting. These notebooks are written to be read by students, so favor clear, well-commented, explanatory code over terse cleverness.

Citing

If you use these materials in teaching or research, please cite the textbook:

Jon E. Froehlich and the Makeability Lab. "Signals: Applied Signal Processing & ML."
Physical Computing interactive textbook, University of Washington.
https://makeabilitylab.github.io/physcomp/signals/

Acknowledgments

Created by Jon E. Froehlich and the Makeability Lab at the University of Washington, with contributions from course staff and students.

License

MIT © 2020 UW Makeability Lab.

About

For teaching applied signal processing and classification for HCI and ubiquitous computing

Resources

Stars

27 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages