apply_butter: Applies a Butterworth filter to each event.

Description Usage Arguments Examples

View source: R/process.R

Description

apply_butter applies a Butterworth filter to the pupil size data.

Usage

1
2
apply_butter(data = data, n = NULL, W = NULL, type = NULL,
  plane = "z")

Arguments

data

A data table object.

n

A number specifying the filter order (as described in butter).

W

The critical frequencies of the filter (as described in butter). W must be a scalar for low-pass or high-pass filters. W must be a two-element vector c(low, high) specifying the lower and upper bands for stop-band or band-pass filters. For digital filters, W must be between 0 and 1 where 1 is the Nyquist frequency.

type

The filter type (as described in butter), one of "low" for a low-pass filter, "high" for a high-pass filter, "stop" for a stop-band (band-reject) filter, or "pass" for a pass-band filter.

plane

A character string (as described in butter), "z" for a digital filter or "s" for an analog filter.

Examples

1
2
3
4
5
6
7
8
# Load example data
data("Pupilex5")

dat <- apply_butter(Pupilex5, n = 1, W = 0.1,
                    type = "low", plane = "z")

# Please see the vignettes for detailed example usage.
vignette("PupilPre_Interpolation_and_Filtering", package="PupilPre")

PupilPre documentation built on March 14, 2020, 1:08 a.m.