View source: R/butterworth_filter_2.R
butterworth_filter_2 | R Documentation |
A helper function which wraps around the [signal::butter()] and [signal::filfilt()] functions. It can be either a low or high pass filter for a given period. (The function can take the period argument because it does the conversion to frequency automatically. (frequency = 1/period).
butterworth_filter(df = NULL, order = 2,
f_low= 1/4, f_high = 1/72, plot = TRUE)
df |
required. A data.frame object where column 1 is a POSIXct object and the other columns are measurement values. |
order |
filter order. Default = 2. |
f_low |
Frequency for the low pass filter. Default = 1/4. |
f_high |
Frequency for the high pass filter. Default = 1/72. |
plot |
logical. If TRUE (default) plots the filtered data over the raw data. Red line is the low pass filter. Blue is the high pass filter. If FALSE, does not plot. |
butter <- butterworth_filter(df = data, f_low = 1/4, f_high = 1/72)
print(butter)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.