Skip to content

makeabilitylab/signals

Repository files navigation

Signals: Applied Signal Processing & ML Notebooks

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 are the source of truth for the Signals module of the Physical Computing interactive textbook. The textbook links to and renders them; this repository is where they are maintained, mirroring how the textbook treats makeabilitylab/arduino. They were 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).

# Lesson Notebook Cloud
1 Intro to Python Tutorials/IntroToPython.ipynb Open In Colab Binder
2 Intro to NumPy Tutorials/IntroToNumPy.ipynb Open In Colab Binder
3 Intro to Matplotlib Tutorials/IntroToMatplotlib.ipynb Open In Colab Binder
4 Quantization & Sampling Tutorials/Signals - Quantization and Sampling.ipynb Open In Colab Binder
5 Comparing Signals (time domain) Tutorials/Signals - Comparing Signals.ipynb Open In Colab Binder
6 Frequency Analysis (DFT/FFT/STFT) Tutorials/Signals - Frequency Analysis.ipynb Open In Colab Binder
7 Step Tracker Projects/StepTracker/StepTracker-Exercises.ipynb Open In Colab Binder
8 Gesture Recognition: Shape-Based Projects/GestureRecognizer/GestureRecognizer-ShapeBased.ipynb Open In Colab Binder
9 Gesture Recognition: Feature-Based Projects/GestureRecognizer/GestureRecognizer-FeatureBased.ipynb Open In Colab Binder
10 Feature Selection & Hyperparameter Tuning Projects/GestureRecognizer/Feature Selection and Hyperparameter Tuning.ipynb Open In Colab Binder

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.

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:

import makelab.signal          # used by the Tutorials notebooks
import gesturerec.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

Some notebooks ship as an exercise/solution pair (*-Exercises.ipynb for students, *-WithExampleSolution.ipynb as the answer key). Instructor-only solution keys (*-Private.ipynb) are intentionally not published.

License

See LICENSE.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors