low_pass_filter: Low-Pass Filter

Description Usage Arguments Details Value Note See Also

View source: R/low_pass_filter.R

Description

low_pass_filter implements a low-pass third-order Butterworth filter.

Usage

1
low_pass_filter(ts, samp_freq, filter_freq = 4)

Arguments

ts

A time series, passed as a vector of chronologically ordered observations separated by equal intervals of time.

samp_freq

Sampling frequency in Hz.

filter_freq

Frequency of the low pass filter. The default value of 4 Hz is recommended for pupil dilation.

Details

This function serves as a wrapper around butter and filter that combines filter construction and implementation and allows the user to specify the filter in terms of the original sampling frequency in Hz and the desired filter in Hz, without having to specify the filter in terms of a fraction of the Nyquist filter.

This function also simplifies the output of the call to filter by converting it into a numerical vector, which can then be used to replace the original time series in a data frame.

Value

A low-pass-filtered copy of the time series.

Note

The low-pass filter assumes that the signal should start from 0, and it will always return a time series that starts from 0.

See Also

artifacts, normalize


jashu/itrak documentation built on May 9, 2020, 1:57 p.m.