# Create a simple example data frame with drift
set.seed(123)
n_frames <- 100
time <- seq(0, 99)
# Create a signal with low-frequency drift
drift <- 0.1 * time
signal <- sin(2 * pi * 0.1 * time) + drift
noise <- rnorm(n_frames, 0, 0.5)
data <- signal + noise
# Create a data frame
df <- data.frame(
time = time,
signal = data
)
# Apply high-pass filtering using cosine basis functions
filtered_df <- high_pass_filter(df, high_pass_model = "cosine")
Run the code above in your browser using DataLab