How newcastleuniversity/dispel works
Project Type and Purpose
• DISPEL is an open-source Python library for Digital Signal Processing (DSP).
• It standardizes extraction of sensor-derived measures (SDMs) from wearables or smartphone data via a modular, object-oriented pipeline.
High-Level Architecture
DISPEL is organized as a layered, plugin-based toolkit rather than a classic front-end/backend web app. It consists of:
A. Data Providers (plugins for different device/data formats)
B. IO Layer (loading, exporting, utility routines)
C. Core Data Model (in-memory representations: collections, epochs, flags, measures, traces)
D. Processing Pipeline (assertions, filtering, epoching, transform, feature extraction)
E. Signal Processing Primitives (filter, DTW, orientation, vector math)
F. Statistical Modules (learning, reliability)
G. Documentation Extensions (Sphinx directives)
H. Utilities & Registry
Main Components & Relationships
1. Data Sources (External)
• Smartphone, wearables, CSV, HDF5, JSON, proprietary formats (ADS, APDM, BDH, sensorlog, etc.)
• Supplied by “dispel/providers/*” modules
2. IO Layer (“dispel/io”)
• Core I/O classes handle raw data import and standardized export
• Utilities handle format detection & conversion
3. Registry (“dispel/providers/registry.py”)
• Dynamically discovers registered providers & tasks
4. Core Data Model (“dispel/data”)
• Central domain objects: DataCollection, DataSet, DataTrace, Epoch, Flag, Measure, Validators
5. Processing Pipeline (“dispel/processing”)
• Pipeline orchestrator calls modules in sequence: assertions → extract → transform → level & flagging → epoch segmentation → measure computation
6. Signal Processing (“dispel/signal”)
• Low-level DSP building blocks (filters, interpolators, orientation estimation, DTW); consumed by processing modules
7. Statistics (“dispel/stats”)
• Post-processing analyses: learning algorithms, reliability metrics
8. Documentation & CLI
• Sphinx extension for measure docs (“dispel/sphinxext”)
• Package entry points (setup.cfg) for console scripts (if any)
Data Flow:
[Providers] → [IO Layer] → [Core Data Model] → [Processing Pipeline] → [Stats Module] → [Export/Visualization]
Architectural Patterns & Design Principles
• Plugin/Registry Pattern: “dispel/providers” auto‐registered tasks for extensibility
• Layered Architecture: clear separation I/O → model → processing → analysis
• Single Responsibility: each module focuses on one stage (e.g., raw import, flagging, transform)
• Dependency Injection: pipeline orchestrator accepts configurable steps & parameters