Metadata-Version: 2.4
Name: Biokinesis_sdk
Version: 1.0.1
Summary: Research-grade Python SDK for combined EMG+IMU wearable sensors
Author: Biokinesis
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.23
Requires-Dist: h5py>=3.7
Requires-Dist: scipy>=1.9
Requires-Dist: pylsl>=1.16
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Biokinesis-SDK SDK

**Research-grade Python SDK for combined EMG+IMU wearable sensors.**

Competes directly with Delsys Trigno — matches or exceeds: 2000 Hz EMG, 9-axis IMU at 148 Hz, 16-bit resolution, configurable bandwidth, bipolar differential EMG, LSL output, multi-format export, up to 16 sensors with hardware sync.

## Installation

```bash
pip install -e .
```

## Quick Start

```python
from biokinesis_sdk.core.types import SensorConfig, FilterConfig, EMGFrame, IMUFrame
from biokinesis_sdk.orchestrator import Orchestrator
from biokinesis_sdk.export import ExportManager
import numpy as np

# Set up orchestrator with 2 sensors
orch = Orchestrator()
orch.add_sensor(SensorConfig(sensor_id=1, label="Biceps",
                             filter_config=FilterConfig.standard()))
orch.add_sensor(SensorConfig(sensor_id=2, label="Triceps",
                             filter_config=FilterConfig.standard()))

# Ingest EMG data
emg_data = np.random.randn(4000) * 500  # 2 seconds at 2 kHz, µV
timestamps = np.arange(4000) * 500.0     # µs timestamps
frame = EMGFrame(sensor_id=1, timestamps_us=timestamps,
                 data=emg_data, sample_rate=2000.0)
orch.ingest_emg(1, frame)

# Export all formats
data = orch.collect_all_data()
ExportManager.export_all(data, "./output", formats=["csv", "hdf5", "mat"])
```

## Modules

| Module | Description |
|--------|-------------|
| `biokinesis_sdk.emg.filters` | Butterworth bandpass (20–450 / 10–850 Hz), 50/60 Hz notch filter |
| `biokinesis_sdk.emg.features` | RMS, MAV, ZCR, iEMG, median/mean frequency, waveform length |
| `biokinesis_sdk.emg.analysis` | Muscle onset detection, MVC normalization, co-contraction index |
| `biokinesis_sdk.imu.preprocessing` | Raw unit conversion, calibration, gyro bias estimation |
| `biokinesis_sdk.imu.fusion` | Quaternion algebra, Madgwick AHRS (6-DOF / 9-DOF) |
| `biokinesis_sdk.imu.kinematics` | Euler angles, gravity compensation, joint angle estimation |
| `biokinesis_sdk.orchestrator` | 16-sensor manager, µs sync, hardware triggers |
| `biokinesis_sdk.export` | CSV, HDF5, LSL, MATLAB .mat |
| `biokinesis_sdk.pipelines` | Gait analysis, fatigue monitoring, prosthetics control |

## Running Tests

```bash
pip install -e ".[dev]"
python -m pytest tests/ -v
```

## License

MIT
