The intended use of this method is for smoothing, although by specifying
wp
and ws
differently one can achieve highpass or bandpass filtering
as well. However, only lowpass filtering should be done on pupillometry data.
Arguments
- eyeris
An object of class
eyeris
derived fromload_asc()
- wp
The end of passband frequency in Hz (desired lowpass cutoff). Defaults to
4
- ws
The start of stopband frequency in Hz (required lowpass cutoff). Defaults to
8
- rp
Required maximal ripple within passband in dB. Defaults to
1
- rs
Required minimal attenuation within stopband in dB. Defaults to
35
- plot_freqz
A flag to indicate whether to display the filter frequency response. Defaults to
FALSE
- call_info
A list of call information and parameters. If not provided, it will be generated from the function call. Defaults to
NULL
Details
This function is automatically called by glassbox()
by default. If needed,
customize the parameters for lpfilt
by providing a parameter list. Use
glassbox(lpfilt = FALSE)
to disable this step as needed.
Users should prefer using glassbox()
rather than invoking this function
directly unless they have a specific reason to customize the pipeline
manually.
Note
This function is part of the glassbox()
preprocessing pipeline and is not
intended for direct use in most cases. Provide parameters via
lpfilt = list(...)
.
Advanced users may call it directly if needed.
See also
glassbox()
for the recommended way to run this step as
part of the full eyeris glassbox preprocessing pipeline
Examples
demo_data <- eyelink_asc_demo_dataset()
demo_data |>
# set lpfilt to FALSE (instead of a list of params) to skip step
eyeris::glassbox(lpfilt = list(plot_freqz = TRUE)) |>
plot(seed = 0)
#> ✔ [ OK ] - Running eyeris::load_asc()
#> ℹ [ INFO ] - Processing block: block_1
#> ✔ [ OK ] - Running eyeris::deblink() for block_1
#> ✔ [ OK ] - Running eyeris::detransient() for block_1
#> ✔ [ OK ] - Running eyeris::interpolate() for block_1
#> ✔ [ OK ] - Running eyeris::lpfilt() for block_1
#> ! [ SKIP ] - Skipping eyeris::downsample() for block_1
#> ! [ SKIP ] - Skipping eyeris::bin() for block_1
#> ! [ SKIP ] - Skipping eyeris::detrend() for block_1
#> ✔ [ OK ] - Running eyeris::zscore() for block_1
#>
#> Block processing summary:
#> block_1: OK (steps: 6, latest: pupil_raw_deblink_detransient_interpolate_lpfilt_z)
#>
#> ✔ [ OK ] - Running eyeris::summarize_confounds()
#> ! [ INFO ] - Plotting block 1 from possible blocks: 1
#> ℹ [ INFO ] - Plotting with sampling rate: 1000 Hz