Main content

Home

Menu

Loading wiki pages...

View
Wiki Version:
In this section you have access to our MATLAB analysis script. The script was written to take care of all aspects of a project's data analysis, from loading the data, processing the data, and creating appropriate figures to visualize results. In the following paragraphs we break down this code and explain how we took our raw data from the Data page and converted it to our beautiful graphs in our Results page. Please feel free to follow along in the code, which is already well commented, explaining everything we did for each line of code written. ---------- **Load Data into Structure** In this section, we loaded each subject's data into a structure. The structure will keep data organized and make it easy to access with for loops later on. The structure will contain information related to each subject, the surface, and each trial on said surface, in that order. Each raw data file will be stored within the subject's surface's respective trial and will store the table described in the Data section. We also convert the Timestamp vector into a time vector by multiplying the # of scans with the time it takes to record one scan. ---------- **Process Data** This section uses the newly created structure "data" to process necessary values. To account for slight differences in iPhone positioning during trials, the magnitude of the acceleration vector (x, y, & z axis) is calculated. We then remove any constant offsets, such as gravity, from the data. Once the raw data is processed, the number of steps can be estimated by counting the peaks in the acceleration data. We do this by defining a minimum peak height value as one standard deviation. We chose this because we knew the acceleration data during the actual trial would produce higher data points than that during the waiting stance start phase. Lastly, we crop the data to only include the steps within the 40m run. We did this by starting the trial from the first step detected until the scan corresponding to the time it took to run the 40m. Now that we have step count, we can find running related metrics such as cadence and the time it took to complete consecutive steps. First, we found the time between steps by simplying finding the time between acceleration peaks. Since we had a vector containing the acceleration peak magnitudes and index, we could find the difference between the index vector and multiple by the time it took to record one sample to get the vector in seconds. From that, we could easily calculate cadence by dividing the time between steps from 60. From this, we then could find average steps, cadence, and time between steps within the same nested for loop. These calculations were then utilized to create our figure. ---------- **Visualize Data** This is the section where all data analysis and visual aids were created based off the processed data above. First, we had a basic overview of step count. The code created a marked scatter plot for each subject's 3 trials of each separate surface. This allows for easy visualization of the processed acceleration data with step count estimation. Second, we had step count analysis. This created a bar graph of the subjects average number of steps over each surface. This was found by counting the average number of peaks present in the cropped acceleration data for all three trials within that surface. Lastly, we had our cadence analysis. This created a bar graph of subjects cadence over surfaces. This was found by taking the average time between each step on all three trials within that surface and dividing 60 by that value to get steps per minute.
OSF does not support the use of Internet Explorer. For optimal performance, please switch to another browser.
Accept
This website relies on cookies to help provide a better user experience. By clicking Accept or continuing to use the site, you agree. For more information, see our Privacy Policy and information on cookie use.
Accept
×

Start managing your projects on the OSF today.

Free and easy to use, the Open Science Framework supports the entire research lifecycle: planning, execution, reporting, archiving, and discovery.