This repository collects small data-processing and plotting tools used to analyze IMU/quaternion sensor recordings from experimental setups (knee/limb movement, proprioception, range-of-motion, etc.). The codebase is organized into focused folders each contains scripts.
This README provides a quick orientation, setup instructions, and examples for the main tools found in the workspace.
-
Linear Displacement/— Main pipeline to compute axis-angle from quaternions, detect sharp drops ("cliffs"), find minima, pair events, and compute a simple metric. Key files:LD_fin_p2.py- Best working implementation for LD analysis and computation, modify the csv path before use.requirements.txt— Python dependencies for this folder.
-
Fourier_mod/— Scripts for frequency-domain processing and reconstruction using FFT and filtering. Key files:main.py— Example FFT + drift-removal pipeline and plotting.main.ipynb— Notebook for exploratory work.requirements.txt— Python dependencies for this folder.
-
Proprioception/— Processing utilities for proprioception experiments and multiple pucks. Key files:prop_latest.py— Final analysis pipelines that preprocess puck data, compute axis-angle and plot cycle-level metrics.requirements.txt— Python dependencies for this folder.
-
Plotting Tool/— Convenient interface to test ROM,Prop and LD scripts with csvs of choice and display all relevant plots and calculations. -
ROM/- Range og Motion calculationrom_latest.py- Best working implementation for ROM analysis and computation, modify the csv path before use.
-
Quart_Estimation/- Deep Learning methods for Quaternion estimation from acc and gyro data.
Requirements: Python 3.8+ (3.10+ recommended), pip, and a venv or virtual environment.
-
Create and activate a virtual environment (Windows PowerShell example):
python -m venv .venv; .\.venv\Scripts\Activate.ps1 -
Install dependencies for the subproject you plan to use. Each subfolder contains a
requirements.txt. Example (install forLinear Displacement):
python -m pip install -r "Linear Displacement\requirements.txt"Install other subproject packages similarly when working in those folders.
Note: Some scripts use SciPy, NumPy, pandas and Matplotlib. If you plan to run notebooks, also install ipython, jupyter and notebook packages.
Below are the typical entry points and how to run them.
(Scripts have an `if __name__ == '__main__'` block pointing to a CSV file in the repository. Edit the path inside the file if you want to point to your own data.)
-
Linear Displacement (example):
- Open a terminal and activate your virtual environment (see above).
- Run the example script which includes a hard-coded CSV path (edit the path if needed):
python "Linear Displacement\LD_fin_p2.py"The script reads CSVs with a common_ts_ms column, computes a timestamp column (IST timezone conversion is used in examples), extracts quaternion columns for puck P1, computes axis-angle, applies a high-pass filter, detects cliff starts and minima, pairs them, computes a simple metric and saves plots such as plot_extrema_pairs_cf_0.025.png.
- Fourier analysis (reconstruction and filtering):
python "Fourier_mod\main.py"This script demonstrates computing axis-angles, performing FFT, and applying Butterworth high-pass filtering with multiple cutoff frequencies. It includes plotting of reconstructed signals.
- Proprioception pipeline:
python "Proprioception\prop_latest.py"- Range of Motion pipeline:
python "ROM\rom_latest.py"Most scripts expect one of the following column layouts in CSV files:
common_ts_ms— integer timestamps in milliseconds. Scripts convert these to pandasdatetimeobjects and often convert to timezoneAsia/Kolkata.- Quaternion columns for pucks named either
P1_QW,P1_QX,P1_QY,P1_QZ(orP2_...).
If your CSV layout differs, check the script's top section where column names are remapped before processing.
This repository is a collection of experimental analysis scripts used for internal research and prototyping.