Skip to content

itspriiyanshu/nrd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nrd — Movement / Sensor Analysis Tools

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.

Contents

  • 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 calculation

    • rom_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.

Quick setup

Requirements: Python 3.8+ (3.10+ recommended), pip, and a venv or virtual environment.

  1. Create and activate a virtual environment (Windows PowerShell example):

    python -m venv .venv; .\.venv\Scripts\Activate.ps1
  2. Install dependencies for the subproject you plan to use. Each subfolder contains a requirements.txt. Example (install for Linear 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.

Running the main examples

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):

    1. Open a terminal and activate your virtual environment (see above).
    2. 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"

Data format expectations

Most scripts expect one of the following column layouts in CSV files:

  • common_ts_ms — integer timestamps in milliseconds. Scripts convert these to pandas datetime objects and often convert to timezone Asia/Kolkata.
  • Quaternion columns for pucks named either P1_QW, P1_QX, P1_QY, P1_QZ (or P2_...).

If your CSV layout differs, check the script's top section where column names are remapped before processing.

Acknowledgements

This repository is a collection of experimental analysis scripts used for internal research and prototyping.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published