Skip to content

makeabilitylab/signals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

88 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Signals: Applied Signal Processing & ML Notebooks

CI Python 3.12 License: MIT Textbook: 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).

# 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.

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:

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

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors