-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
- MATLAB R2020b+ or GNU Octave 7+
- Optional: C compiler for MEX acceleration (macOS: Xcode CLT, Linux: GCC, Windows: MSVC)
- No external toolbox dependencies
Clone or download the FastSense repository, then run the installer:
cd /path/to/fastsense
installThis command:
- Adds all library paths (
libs/FastSense,libs/SensorThreshold,libs/EventDetection,libs/Dashboard,libs/WebBridge) - Initializes the Tag registry and theme cache
- (Optionally) compiles MEX accelerators if a C compiler is detected
Run the test suite to confirm everything is working:
addpath('tests')
run_all_tests()Expected output: ~85 tests passing on MATLAB, ~70 tests passing on Octave (some platform-specific skips). Or run a quick visual demo:
example_basicThis renders a 10M-point sine wave with thresholds and violation markers in ~2 seconds.
The core downsampling and violation detection functions have optional C implementations with SIMD intrinsics (AVX2/NEON) that deliver 3–50× speedups. If MEX files are not compiled, pure-MATLAB fallbacks are used automatically.
cd libs/FastSense
build_mexAuto-detection:
- arm64 (Apple Silicon, ARM servers): NEON intrinsics
- x86_64 (Intel/AMD): AVX2 with SSE2 fallback
- Octave compatibility: Tested on Octave 7–11 with bundled SQLite3
Accelerated functions:
-
binary_search_mex— viewport clipping lookup (10–20× faster) -
minmax_core_mex— per-pixel MinMax downsampling (3–10×) -
lttb_core_mex— LTTB curve-preserving downsampling (10–50×) -
violation_cull_mex— fused violation detection + pixel culling -
build_store_mex— SQLite bulk write (10–20× faster) -
mksqlite— SQLite C bindings for DataStore
If a compiler is not available or compilation fails, the library falls back gracefully to pure-MATLAB implementations with identical behavior.
If you're using the Python WebBridge component:
pip install fastsense-bridge
python -m fastsense_bridge --matlab-port 9001 --host localhost --port 8000This installs and runs the Python FastAPI server that connects to MATLAB's TCP bridge.
git clone https://github.com/yourorg/fastsense.git
cd fastsense
matlab -nojvm -nodisplay -r "install; exit"A pre-built Docker image includes Octave + FastSense + compiled MEX:
docker run -it ghcr.io/yourorg/fastsense:latest
octave --eval "install; run_all_tests"graph TB
A["FastSense<br/>(Core Plotting)"] -->|renders| B["Dashboard Engine<br/>(Widgets & Layouts)"]
A -->|monitors| C["SensorThreshold<br/>(Tag-based Sensors)"]
C -->|detects| D["EventDetection<br/>(Violation Events)"]
B -->|exposes via| E["WebBridge<br/>(REST/WebSocket)"]
F["Python Bridge"] -.->|queries| E
style A fill:#fffacd
style B fill:#f5f5dc
style C fill:#e6d7ff
style D fill:#ffe6cc
style E fill:#cce5ff
| Library | Directory | Purpose |
|---|---|---|
| FastSense | libs/FastSense/ |
Ultra-fast time-series plotting with downsampling & caching |
| SensorThreshold | libs/SensorThreshold/ |
Tag-based sensors with state-dependent thresholds |
| EventDetection | libs/EventDetection/ |
Violation detection, event storage, Gantt timelines |
| Dashboard | libs/Dashboard/ |
Widget layouts, responsive grid, JSON serialization |
| WebBridge | libs/WebBridge/ |
TCP server for web & external clients |
- Native support for all features
- MEX compilation requires MATLAB Coder or a standalone C compiler
-
datetimeX-axis formatting is automatic
- All core features supported (FastSense, Dashboard, EventDetection)
- MEX compilation:
sudo apt-get install octave-dev(Linux) or Homebrew (macOS) - WebBridge uses Octave's HTTP client (no external server dependency)
- Some graphics quirks: uicontrol buttons may not render in headless mode; use headless export flags for automated dashboards
- MEX auto-detects ARM64 and uses NEON intrinsics
- Xcode Command Line Tools required:
xcode-select --install
- MSVC compiler required: Install Visual Studio Build Tools
- Path handling: Use forward slashes in file paths or raw strings
"C:\path"(not'C:\path')
- GCC auto-detects AVX2 (x86_64) or NEON (ARM64)
- On Ubuntu:
sudo apt-get install build-essential
Symptom: build_mex() errors with compiler not found or syntax error.
Solution:
- Verify compiler is installed:
mex -setup % MATLAB mkoctfile --version % Octave
- If not installed, download:
-
macOS:
xcode-select --install -
Linux:
sudo apt-get install build-essential - Windows: Visual Studio Build Tools (MSVC)
-
macOS:
- Re-run
build_mex()
Fallback: If compilation fails, pure-MATLAB implementations are used automatically. Performance is ~3–10× slower but fully functional.
Symptom: Undefined function 'mksqlite' when using disk-backed storage.
Solution:
- Ensure MEX is compiled:
build_mex() - Verify SQLite3 is available (bundled in
libs/FastSense/private/mex_src/sqlite3.c) - On Octave, check MEX support:
mkoctfile --version
Fallback: DataStore operations revert to all-in-memory mode (warning issued).
Symptom: A few tests fail with "object deletion" crashes on Octave 8–10.
Solution: Upgrade to Octave 11.1.0 (released 2026-02-18), which fixes upstream bug #67749. Alternatively, use MATLAB R2020b+ which has no such issue.
Symptom: DashboardEngine.render() opens figure but widgets appear blank.
Solution:
- Verify display is available:
~isempty(get(0, 'CurrentFigure')) - On headless systems, use flag:
install('SKIP_GRAPHICS', true)and work with data-only APIs - Check MATLAB version: R2020b or later required
- Force a redraw:
drawnow('expose')
- Getting-Started — Step-by-step tutorial with your first 10M-point plot
- Examples — Explore 80+ categorized runnable examples
- API-Reference:-FastSense — Learn the core plotting API
- Performance — Understand optimization techniques and benchmarks
- Issues: Report bugs on GitHub Issues
- Discussions: Ask questions on GitHub Discussions
- Contributing: See CONTRIBUTING.md for development guidelines
Happy plotting! 📊
FastSense Wiki
API Reference
Guides
Use Cases
Internals
Resources