R/bandpass.R

Defines functions bandpass

Documented in bandpass

#' @name bandpass
#' @aliases bandpass
#' @title Optional bandpass filtering using the Butterworth filter.
#' @description Id
#'
#' @keywords internal 


bandpass <- function(data, butterfreq) {
  bf1 <- signal::butter(5, butterfreq, type = "pass", plane = "z")
  for (i in 1:ncol(data)) {
    data[, i] <- signal::filter(bf1, data[, i] - mean(data[, i]))
  }
  return(data)
}

Try the detectR package in your browser

Any scripts or data that you put into this service are public.

detectR documentation built on June 22, 2024, 12:23 p.m.