This repository contains a Python implementation for analyzing BVH motion capture data using the Hilbert-Huang Transform (HHT) and Multivariate Empirical Mode Decomposition (MEMD). This approach enables effective frequency and amplitude analysis of complex, non-linear and non-stationary motion data.
Watch a demonstration of this analysis on YouTube:
The Hilbert-Huang Transform (HHT) is a time-frequency analysis method particularly well-suited for analyzing non-linear and non-stationary data. This implementation applies HHT to motion capture data stored in BVH format, allowing researchers and animators to extract meaningful frequency and amplitude information from complex movements.
- BVH File Handling: Read and write BVH motion capture files
- Multivariate Empirical Mode Decomposition (MEMD): Decompose motion signals into Intrinsic Mode Functions (IMFs)
- Hilbert Spectral Analysis: Extract instantaneous frequency and amplitude information
- Visualization: Generate Hilbert spectral plots for selected joints
- Motion Decomposition: Output individual IMF components as BVH files for visualization
- NumPy
- Matplotlib
- Custom modules:
MEMD_all.py: Multivariate EMD implementationht.py: Hilbert Transform utilities
- Place your BVH files in the
datadirectory - Edit the file path in
motionAnalysisHHT.pyto point to your BVH file - Run the script:
python motionAnalysisHHT.py- The script will generate:
- Hilbert spectrum visualizations in the
visualizationdirectory - Decomposed motion components in the
decompositiondirectory
- Hilbert spectrum visualizations in the
The script analyzes specific joints by default:
- Joint 27: RightLeg
- Joint 12: LeftLeg
- Joint 45: Neck
- Joint 78: RightArm
- Joint 57: LeftArm
You can modify the joint selection in the script by editing the joints array.
The analysis produces Hilbert spectrum plots showing how frequency components of motion change over time with color-coded amplitude. This helps identify patterns, periodicity, and energy distribution in the motion.
Each IMF component is also exported as a BVH file, allowing you to visualize different frequency components of the motion separately.
This project is available under MIT License. See the LICENSE file for more details.
If you use this code in your research, please cite:
@article{dong2020motion,
title={Motion capture data analysis in the instantaneous frequency-domain using hilbert-huang transform},
author={Dong, Ran and Cai, Dongsheng and Ikuno, Soichiro},
journal={Sensors},
volume={20},
number={22},
pages={6534},
year={2020},
publisher={MDPI},
doi={10.3390/s20226534}
}
@article{dong2023biomechanical,
title={Biomechanical analysis of golf swing motion using hilbert--huang transform},
author={Dong, Ran and Ikuno, Soichiro},
journal={Sensors},
volume={23},
number={15},
pages={6698},
year={2023},
publisher={MDPI},
doi={10.3390/s23156698}
}
For questions or collaboration opportunities, please open an issue in this repository.
