sampling_rate estimates the sampling rate based on the average time
intervals between adjacent samples for the input multi-channel signal.
dataframe. Input dataframe of the multi-channel signal. The first column is the timestamps in POSXlct format and the following columns are accelerometer values.
number. The estimated sampling rate in Hz.
This function accepts a dataframe of multi-channel signal, computes the duration of the sequence, and gets the sampling rate by dividing the number of samples by it.
This function is a utility function that was used in various part in the algorithm whenever we need to know the sampling rate.
# Get the test data df = sample_raw_accel_data # Default sampling rate is 80Hz sampling_rate(df)#>  80# Downsample to 30Hz output = bandlimited_interp(df, 80, 30) sampling_rate(output)#>  30# Upsampling to 100Hz output = bandlimited_interp(df, 80, 100) sampling_rate(output)#>  100