interpolate_signal | R Documentation |
interpolate_signal
applies different interpolation algorithms to the
input multi-channel signal to fill in the missing samples and harmonizes the
sampling rate.
interpolate_signal( df, method = "spline_natural", sr = 100, st = NULL, et = NULL )
df |
dataframe. Input multi-channel accelerometer signal. |
method |
string. Interpolation algorithms. Could be "spline_natural",
"spline_improved" or "spline_fmm": see |
sr |
number. Sampling rate in Hz of the output signal. Default is 100. |
st |
POSIXct date. The start time for interpolation. If it is
|
et |
POSIXct date. The end time for interpolation. If it is |
dataframe. Interpolated signal.
This function is a utility
function that has been used in functions: extrapolate
, and
simulate_new_data
.
Other utility functions:
clip_data()
,
cut_off_signal()
,
parse_epoch_string()
,
sampling_rate()
,
segment_data()
,
simulate_new_data()
# Use sample data df = sample_raw_accel_data # Plot input illustrate_signal(df, plot_maxed_out_line=FALSE) # Interpolate to 100 Hz sr = 100 # Interpolate the entire sequence of data output = interpolate_signal(df, sr=sr) # Plot output illustrate_signal(output, plot_maxed_out_line=FALSE) # Interpolate part of the sequence output = interpolate_signal(df, sr=sr, st=df[10,1], et=df[100,1]) # Plot output illustrate_signal(output, plot_maxed_out_line=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.