The goal is to implement a function that will calculate the moving mean of a measurement object and return a new, downsampled, measurement object. This moving mean will be implemented using a dynamic time window; we will use the exact time stamps and not the number of samples to find the window size corresponding to the desired window length, in seconds. The moving_mean function is necessary as all metrics are analyzed at an epoch level, not on a per-sample level. The moving_mean function is essentially a non-overlapping sliding window.
The inputs of the function will be a Measurement object, containing the specific sensor data that we want to downsample, the epoch_length (int) that provides the number of seconds that defines the window size. The function returns a new Measurement object with the downsampled sensor data and the new, corresponding time information.
Tasks
[x] The function will take as input an instance of the Measurement class and a positive, non-zero, integer defining the window length, in seconds.
[x] The function will implement a dynamically sized window based on the timestamps in Measurement.time and then take the mean of each window.
[x] The result of the moving mean will be a new instance of the Measurement class and this will be returned.
Description
The goal is to implement a function that will calculate the moving mean of a measurement object and return a new, downsampled, measurement object. This moving mean will be implemented using a dynamic time window; we will use the exact time stamps and not the number of samples to find the window size corresponding to the desired window length, in seconds. The moving_mean function is necessary as all metrics are analyzed at an epoch level, not on a per-sample level. The moving_mean function is essentially a non-overlapping sliding window.
The inputs of the function will be a Measurement object, containing the specific sensor data that we want to downsample, the epoch_length (int) that provides the number of seconds that defines the window size. The function returns a new Measurement object with the downsampled sensor data and the new, corresponding time information.
Tasks
Freeform Notes
No response