-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
FastPlot supports:
- MATLAB: R2020b and later
- GNU Octave: 7.0 and later
- Operating Systems: macOS (Apple Silicon & Intel), Linux, Windows
-
Compiler (optional): C compiler for MEX acceleration
- macOS: Xcode Command Line Tools (
xcode-select --install) - Linux: GCC/Clang (
apt-get install build-essentialor equivalent) - Windows: MSVC (included with Visual Studio Community)
- macOS: Xcode Command Line Tools (
No MATLAB or Octave toolboxes are required. All functionality is pure MATLAB/Octave or self-contained C code.
The recommended approach for full functionality and development:
git clone https://github.com/HanSur94/FastSense.git
cd FastSenseThen in MATLAB/Octave:
install;This command:
- Adds the five core libraries to your path
- Detects and optionally compiles MEX accelerators
- Verifies core classes are accessible
- Runs JIT warmup on MATLAB for optimal performance
graph LR
A["Clone Repository"] --> B["Run install.m"]
B --> C["Add Library Paths"]
B --> D["Detect Compiler"]
D --> E["Compile MEX Optional"]
B --> F["Verify Installation"]
C --> G["Ready to Use"]
E --> G
F --> G
If you prefer manual setup:
repo_root = '/path/to/FastSense';
addpath(genpath(fullfile(repo_root, 'libs')));
addpath(fullfile(repo_root, 'examples'));
addpath(fullfile(repo_root, 'tests'));Then verify:
help FastSense % Should display class documentationFor maximum performance (3-50x speedups on downsampling and search), compile the C MEX kernels:
cd /path/to/FastSense/libs/FastSense
build_mex();| MEX Function | Purpose | Speedup |
|---|---|---|
binary_search_mex |
Visible range lookup on sorted time arrays | 10-20x |
minmax_core_mex |
Per-pixel MinMax downsampling with SIMD | 3-10x |
lttb_core_mex |
Largest-Triangle-Three-Buckets downsampling | 10-50x |
violation_cull_mex |
Violation detection + pixel-density culling | 5-20x |
mksqlite |
SQLite interface with typed BLOB storage | 2-3x |
The build system auto-detects your CPU and applies appropriate optimizations:
- Apple Silicon (arm64): NEON intrinsics (2 doubles/instruction)
- Intel/AMD x86_64: AVX2 with SIMD intrinsics (4 doubles/instruction), falls back to SSE2
- Fallback (scalar): Pure C loops if no SIMD detected
If compilation fails, pure-MATLAB implementations are used automatically — all algorithms produce identical numerical results.
MATLAB on Windows:
setenv('VS160COMNTOOLS', 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\');
build_mex();Octave on macOS:
brew install gcc # If not installed
export CC=gcc-12
octave --eval "cd libs/FastSense; build_mex();"Disable MEX and use pure MATLAB:
% Edit libs/FastSense/build_mex.m, line 5:
% useMex = false; % Force pure-MATLAB mode
build_mex();install;
% Create a simple plot
x = linspace(0, 2*pi, 1e6);
y = sin(x);
fp = FastSense('Title', 'Test Plot');
fp.addLine(x, y, 'DisplayName', 'sin(x)');
fp.addThreshold(0.5, 'Direction', 'upper', 'Label', 'Threshold');
fp.render();
fprintf('✓ FastSense core working\n');install;
cd tests
run_all_tests();Expected output:
====== Test Summary ======
Total tests: 287
Passed: 287
Failed: 0
Skipped: 12 (Octave listener incompatibilities)
======== SUCCESS =========
install;
example_basic; % 10M point basic plot
% or
example_dashboard_engine; % Widget gallery
% or
example_event_detection_live; % Event monitoringAfter installation, your FastPlot directory contains:
FastSense/
├── install.m # Setup script (run this first)
├── setup.m # Path configuration
│
├── libs/ # Core libraries
│ ├── FastSense/ # Ultra-fast plotting engine
│ ├── SensorThreshold/ # Sensor data + threshold rules
│ ├── EventDetection/ # Violation-based event detection
│ ├── Dashboard/ # Widget-based dashboard UI
│ └── WebBridge/ # TCP server for web visualization
│
├── examples/ # 80+ runnable examples
│ ├── example_basic.m
│ ├── example_dashboard_engine.m
│ ├── example_event_detection_live.m
│ └── ...
│
├── tests/ # 287+ unit and integration tests
│ ├── suite/ # MATLAB unittest classes
│ ├── test_*.m # Octave-compatible function tests
│ └── run_all_tests.m
│
├── bridge/ # Python/web components
│ ├── python/ # FastAPI bridge server
│ └── web/ # Vanilla JS + uPlot frontend
│
├── docs/ # Design documents and benchmarks
├── wiki/ # GitHub wiki content (Markdown)
└── scripts/ # Build, test, and utility scripts
For datasets exceeding available RAM, FastSense automatically uses SQLite disk storage:
install;
% 100M points — too large for RAM (~800 MB)
x = linspace(0, 100, 1e8);
y = sin(x) + 0.1*randn(1, 1e8);
fp = FastSense();
fp.addLine(x, y, 'StorageMode', 'auto', 'MemoryLimit', 500e6); % 500 MB limit
fp.render();
% Data automatically spilled to disk, visible region loaded on zoomDisk storage creates .fpdb files (SQLite with indexed chunks) in your temp directory, automatically cleaned up on completion.
For web-based visualization:
cd FastSense/bridge/python
pip install -e .
# Start the bridge (MATLAB must be running WebBridge server)
fastsense-bridge --matlab-port 9000 --http-port 8080
# Open http://localhost:8080 in browserOr in MATLAB:
install;
dashboard = DashboardEngine('Title', 'Production Monitor');
% ... add widgets ...
dashboard.serve(); % Starts WebBridge TCP server + Python bridgeThen visit http://localhost:8080 in your browser.
Pull the latest changes:
cd /path/to/FastSense
git pull origin mainThen re-run setup:
install;
build_mex(); % Recompile MEX if source files changedMake sure install; was run in the FastSense directory:
cd /path/to/FastSense
install;
addpath(genpath('libs')); % Manual fallbackUse pure-MATLAB mode as fallback:
% Create a file: libs/FastSense/private/useMexDisabled.txt
% Then MEX functions will auto-fallback to MATLAB implementations
build_mex(); % Will skip MEX compilationchmod +x /path/to/FastSense/install.m
chmod -R u+w /path/to/FastSense/libs # Ensure write permissionsUse disk-backed storage:
fp = FastSense('StorageMode', 'disk'); % Force disk storage
fp.addLine(x, y); % Data written to SQLiteAfter successful installation:
- Quick Start (5 min): Read Getting Started Guide
-
Learn Core API (30 min): Run
example_basic.mandexample_dashboard_engine.m -
Explore Features (1 hour): Try
example_visual_features.mandexample_sensor_threshold.m - Deep Dive: Read Architecture for design principles
Typical performance on modern hardware (M1 Mac, 2024 Windows laptop):
- 10M point plot: 4.7ms refresh (212 FPS), 99.96% point reduction
- 100M point disk-backed: <10ms zoom with automatic viewport loading
- Dashboard with 30 widgets: <500ms initial load, <50ms live updates
These metrics assume MEX compilation. Pure-MATLAB mode adds ~2-3x overhead but remains responsive for typical datasets (<10M points).
- Documentation: Wiki
-
Examples:
examples/directory with 80+ runnable scripts -
API Reference:
wiki/API-Reference-*.mdfiles - Issues: GitHub Issues
FastSense Wiki
API Reference
Guides
Use Cases
Internals
Resources