Skip to content

akoziol98/Processing-Sensor-Data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Processing Sensor Data

This repository contains translation of the scripts analysing mutidimensional motor data acquired via wearable sensors and adjusted to process reaching movements. The code was translated from Matlab to Python. Find the original code and the author, David López Pérez, here: https://github.com/Mirandeitor/entropyPaper and https://github.com/Mirandeitor/frontiersRhythmicPaper

Scripts

Descriptions by the original author: https://github.com/Mirandeitor/entropyPaper and https://github.com/Mirandeitor/frontiersRhythmicPaper

Main Script

scriptRhytmic.py -> controls the whole process of analysis. The script loads the data from one of the tasks and processes the data using multidimensional RQA on the time series of interest. Particularly:

  • First select all the infant codes and visits from a parent folder where all the subfolders with the sensor data are located.
  • Loads a conversion file which main goal is to convert the sensor internal codes to body parts of interest.
  • Prompt a gui to select which parts are of interest for the analysis and remove unimportant data to save some memory.
  • Pre-process the data by filtering and interpolating missing data.
  • Then the movement time series are generated by calculating the the magnitude of the acceleration.
  • Then there is a synchronisation process that loads the manually coded data from ELAN and synchronise video and sensor based on the infant reaching.

Snippets

Here there a series of functions that are called from the main script:

  • loadCodes_BodyParts.py -> load the codes and bodyparts from the codingFile (contains body parts to sensor codes conversion) to limit the analysis to certain body parts.

  • filterSensorData.py -> loads the data and return the interpolated and filtered data.

  • interpolateSensorData.py -> this function interpolates the data from the sensor data to remove missing values.

  • prepareDataForInterpolation.py -> this function takes an input array and return the data ready for interpolation with the missing values exactly in the place that it should be.

  • loadSensorProcessingOptions.py -> this function asks the user which kind of data will be analysed (quaternions or acceleration).

  • estimateSensorDisplacement.py -> estimate the movement (acc or quaternions) based on the sensor filtered data and options previously asked to the user.

  • estimateDelaySide.py -> return the delay between the coded time series and the sensor time series.

  • cropData.py -> if the difference between video and sensor data is more than 1 second, this script is asking the user to pick which part of the longer data to cut

  • correctForDelaySide.py -> corrects video or sensor data time series based on the delay quantified in the delay estimation method.

  • categorisedMovementAboveMean.py -> convert to 1s and 0s the input time series so it can be later used to estimate the delay between the manually coded data and the sensor recordings or to estimate the number of reaching.

  • drpdfromtsCat.py -> explore the cross-recurrence diagonal profile of two-time series to find the delay between them.

Citation

If you ever use parts of this code for your analysis please cite:

  • Laudańska, Z., López Pérez,D., Kozioł, A., Radkowska, A., Babis, K.,Malinowska-Korczak, A., Tomalski, P. (2022). Longitudinal changes in infants' spontaneous rhythmic arm movements during rattle-shaking play with caregivers In Review
  • Laudańska Z., López Pérez D., Radkowska A., Babis K., Malinowska-Korczak A., Wallot S. & Tomalski P. (2022). Changes in the complexity of limbs movements during the first year of life across different tasks. Entropy, 24(4), 552. doi: 10.3390/e24040552

Contact

Any missing function or questions about the code please contact the original author: d.lopez@psych.pan.pl, or translator to Python: akoziol@sd.psych.pan.pl

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages