Offline, physics-first vibration intelligence system for SME industrial machinery. Detects bearing wear, misalignment, cavitation, and imbalance before catastrophic failure.
Built on AMD Ryzen AI edge hardware. Zero cloud dependency. Alerts in Hindi, Marathi, English.
Host Machine
βββ Node A (C++ DSP)
Subscribes: USB Audio (44.1kHz)
Publishes: ZMQ tcp://*:5555 [1024Γ64 spectrogram tensor]
Docker Network
βββ Node B (Python Inference)
β Subscribes: ZMQ :5555
β Publishes: ZMQ :5557 {mse, rms, severity, alert}
β Runtime: ONNX Runtime (CPU dev) Β· Vitis AI (NPU target)
β
βββ Web (Node.js + React Dashboard)
β Subscribes: ZMQ :5557
β Serves: http://localhost:3001
β
βββ LLM (Llama 3.1 8B β Optional)
Serves: :11434 via Ollama (local only, no cloud API)
Resonance/
βββ src/ # Node A β C++ DSP Engine
β βββ main.cpp
β βββ ear.cpp # PortAudio input capture
β βββ fft.cpp # FFTW3 FFT processing
β βββ filters.cpp # High-pass / low-pass filters
β βββ spectrogram.cpp # Log-magnitude spectrogram
β βββ broadcaster.cpp # ZMQ PUB :5555
β βββ safety.cpp # RMS safety gate
β
βββ include/resonance/ # C++ header files
β βββ ear.hpp
β βββ fft.hpp
β βββ filters.hpp
β βββ spectrogram.hpp
β βββ broadcaster.hpp
β βββ safety.hpp
β
βββ python/
β βββ inference/
β β βββ main.py # Node B β ONNX inference + LLM alerts
β βββ llm/
β β βββ handler.py # LLMProvider β LocalLLM β LLMHandler
β βββ training/
β β βββ collect_data.py # Healthy baseline collection
β β βββ dataset.py # Spectrogram dataset loader
β β βββ model.py # ConvAutoencoder architecture
β β βββ train.py # Training loop
β β βββ export_onnx.py # PyTorch β ONNX export
β βββ onnx/
β β βββ autoencoder.onnx # Deployed model
β β βββ model_hash.txt # SHA-256 integrity hash
β βββ weights/
β β βββ autoencoder.pth # PyTorch checkpoint
β β βββ norm_stats.json # Normalization parameters
β βββ utils/
β β βββ config.py # Thresholds, ZMQ endpoints, LLM config
β β βββ zmq_receiver.py # ZMQ subscriber
β β βββ rms_monitor.py # Standalone RMS visualizer
β β βββ dsp.py # DSP utilities
β βββ tests/
β β βββ mock_node_a.py # ZMQ mock publisher for testing
β β βββ evaluate_model.py # MSE threshold evaluation
β β βββ verify_e2e.py # End-to-end pipeline verifier
β βββ run_inference.py # Entry point
β βββ requirements.txt
β βββ Dockerfile
β βββ README.md
β
βββ web/ # Node C β React Dashboard
β βββ app/ # React components + hooks
β βββ styles/ # CSS + Tailwind
β βββ server.js # Node.js relay (ZMQ β Socket.IO)
β βββ index.html
β βββ package.json
β βββ vite.config.ts
β βββ Dockerfile
β
βββ schema/ # Data schemas
βββ docker-compose.yml
βββ runall.sh # Start all services locally
βββ CMakeLists.txt
βββ README.md
- Tier 1 β Raspberry Pi Zero 2W Β· USB Audio Adapter (C-Media CM108 compatible) Β· Piezo disc 35mm
- Tier 2 β AMD Ryzen AI Mini PC Β· XDNA NPU Β· 50 TOPS Β· Vitis AI Runtime
- Tier 3 β Ryzen 5 Edge Mini PC Β· Node.js dashboard Β· PostgreSQL archive
- Any Linux machine with Docker installed
- USB audio adapter or built-in microphone
- Node A validated on x86 β Pi Zero 2W deployment target
| Component | Spec | Cost |
|---|---|---|
| Raspberry Pi Zero 2W | Quad-core ARM 1GHz 512MB | βΉ1,299 |
| USB Audio Adapter | C-Media CM108 44.1kHz | βΉ299 |
| Piezo Disc 35mm | PZT ceramic contact | βΉ80 |
| 1.2MΞ© Bias Resistor | 1/4W carbon film | βΉ2 |
| 1Β΅F Capacitor | 25V electrolytic DC block | βΉ8 |
| 2N3819 JFET Buffer | N-ch TO-92 impedance match | βΉ20 |
| Total BOM | βΉ2,491 |
git clone https://github.com/HSKCTA/Resonance.git
cd Resonance
mkdir build && cd build
cmake ..
make
./resonance_node_aNode A begins publishing spectrograms on ZMQ tcp://*:5555.
cd python
pip install -r requirements.txt
python run_inference.pyNode B subscribes to :5555 and publishes results on :5557.
cd web
npm install
npm run devDashboard available at http://localhost:5173
./runall.sh # starts all 5 services
./runall.sh stop # stops everythingNode A must run on host to access USB audio hardware:
cd build
./resonance_node_adocker compose up --buildThis starts Node B (inference), Web (dashboard), and the Ollama LLM container.
http://localhost:3001
Pull Llama 3.1 8B for local multilingual fault explanations:
docker exec -it resonance_ollama ollama pull llama3.1:8bIf not pulled, system runs with fallback rule-based alert text. LLM delivers fault explanations in English, Hindi, and Marathi.
Piezo Sensor
β
βΌ
PortAudio (44.1kHz capture)
β
βΌ
High-Pass Filter (100Hz) + Low-Pass Filter (12kHz)
β
βββ RMS Amplitude β Safety Gate (ISO 10816 threshold)
β βββ HARDWARE ALARM if RMS > threshold (bypasses AI)
β
βΌ
FFTW3 (2048-pt FFT Β· 75% overlap)
β
βΌ
Log-Magnitude Spectrogram [1024 Γ 64]
β
βΌ
ZMQ PUB :5555
β
βΌ
ConvAutoencoder (ONNX Runtime Β· CPU / AMD Ryzen AI NPU)
β
βΌ
MSE Reconstruction Error
β
βββ MSE > 0.180 β ANOMALY DETECTED
β βββ Llama 3.1 8B LLM β alert in Hindi / Marathi / English
β
βββ MSE β€ 0.180 β NORMAL
Industrial faults produce specific spectral signatures detectable weeks before failure:
| Fault Type | Spectral Signature | Detection Method |
|---|---|---|
| Bearing Wear | High-frequency harmonics >5kHz | Autoencoder MSE |
| Misalignment | Strong 2Γ 3Γ shaft frequency peaks | FFT harmonic analysis |
| Looseness | Frequency sidebands | Spectral analysis |
| Imbalance | Large 1Γ shaft frequency peak | RMS safety gate |
Standards compliance: ISO 10816-3:2009 Β· ISO 13373-1:2002
| Property | Value |
|---|---|
| Architecture | Convolutional Autoencoder |
| Input | 1024Γ64 log-magnitude spectrogram |
| Training data | Healthy vibration only (unsupervised) |
| Loss function | Mean Squared Error (MSE) |
| Anomaly threshold | 0.180 (calibrated on healthy baseline data) |
| Export format | ONNX FP32 |
| Runtime | ONNX Runtime (CPU) Β· Vitis AI (NPU target) |
| Inference latency | 3ms median CPU Β· ~1.4ms projected AMD NPU |
| Parameters | ~180K |
Min-max normalization applied before inference.
Parameters stored in python/weights/norm_stats.json.
Must be regenerated if sensor hardware changes β run collect_data.py then train.py.
- Trained on small healthy dataset β retrain on target machine for best results
- Single fault type detection β fault classifier roadmap Q2 2026
- Threshold calibrated manually β adaptive threshold planned
cd python
python tests/evaluate_model.pyReports MSE distribution on training data and recommended threshold.
| Parameter | Value |
|---|---|
| Sample rate | 44,100 Hz |
| FFT size | 2048 points |
| Overlap | 75% |
| Frequency bins | 1024 |
| Time steps | 64 |
| Output shape | [1, 1024, 64] |
Model: ConvAutoencoder FP32 ONNX Β· Input: 1024Γ64 Β· Runs: 1000 Β· Warmup: 50
| Metric | CPU (x86 dev) | NPU Projection* |
|---|---|---|
| Mean | 7.0 ms | ~1.4 ms |
| Median (P50) | 3.0 ms | ~0.6 ms |
| P95 | 21.7 ms | ~4.3 ms |
| P99 | 27.7 ms | ~5.5 ms |
| Min | 1.3 ms | β |
| Max | 34.7 ms | β |
*NPU projection: AMD Ryzen AI XDNA 50 TOPS Β· ~5Γ CPU speedup for FP32 ONNX via Vitis AI Runtime Β· Ryzen AI 9 HX 370 Β· validated benchmarks pending target hardware.
| Stage | Latency |
|---|---|
| FFT (64 hops Β· 2048-pt) | 1.5 ms |
| Spectrogram build | 0.09 ms |
| Audio buffer fill* | ~743 ms |
*Audio buffer fill requires 64 frames at 44.1kHz to construct one spectrogram. This is a physics constraint identical across all vibration monitoring systems.
Tested: mock_node_a β ZMQ :5555 β Node B (ONNX) β ZMQ :5557 β verifier
| Metric | Result |
|---|---|
| Frames tested | 10/10 successful |
| Pipeline mean (ZMQ + inference) | 30.9 ms |
| Pipeline worst case | 51.0 ms |
| Audio buffer fill | ~743 ms (physics) |
| Full sensor-to-alert | ~774 ms mean |
| MSE on healthy data | ~0.003 (consistent) |
| ZMQ transport | β verified |
| LLM fallback | β graceful β no crash on unavailable model |
Pipeline target: <100ms inference β (30.9ms measured)
- CPU: AMD Ryzen 5 (Yoga 6 13ARE05)
- OS: Linux
- Runtime: ONNX Runtime Β· CPUExecutionProvider
- DSP: C++17 Β· FFTW3 Β· PortAudio
- Inference runs: 1000 Β· Warmup: 50
- No audio data leaves the local network
- Human voice range (80Hzβ3kHz) filtered before AI layer β conversations never processed
- No cloud dependency for core inference
- Air-gapped factory deployment supported
- LLM runs locally via Ollama β no external API calls in production
- Read-only system β never sends control commands to machinery
| Tier | Hardware | BOM Cost | Deploy Price |
|---|---|---|---|
| Tier 1 β Sensor Node | Pi Zero 2W + Piezo | βΉ2,491 | βΉ3,499 |
| Tier 2 β NPU Zone | AMD Ryzen AI Mini PC | βΉ81,296 | βΉ89,999 |
| Tier 3 β Master Node | Ryzen 5 Edge Mini PC | βΉ64,996 | βΉ72,999 |
| 20-machine SME | 2 zones + 1 master | β | βΉ3,47,977 |
SKF equivalent: βΉ9,00,000 hardware + βΉ2,00,000/yr cloud. Resonance: 85% cheaper. Zero cloud cost.
| Phase | Timeline | Feature |
|---|---|---|
| Q1 2026 | Now | ConvAutoencoder Β· batched NPU inference Β· 50 sensors/zone |
| Q2 2026 | 3 months | Fault type classifier β bearing vs imbalance vs looseness |
| Q3 2026 | 6 months | Remaining useful life estimator β LSTM on MSE trend |
| Q4 2026 | 12 months | Multi-factory dashboard Β· SCADA integration Β· AMD EPYC |
Hitesh Khare β Systems Engineering Β· C++ DSP Core Tanmay Bhole β AI/ML Architecture Β· Model Training Β· GenAI
AMD Slingshot 2026 Β· Team DataNOtfOund

