iir_filt: Butterworth IIR filter

Description Usage Arguments Details Methods (by class) Author(s) Examples

View source: R/filtering.R

Description

Construct a Butterworth IIR filter and filter input data. This uses signal::filt_filt, which filters the signal twice to - once forwards, then again backwards).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
iir_filt(data, ...)

## S3 method for class 'data.frame'
iir_filt(
  data,
  low_freq = NULL,
  high_freq = NULL,
  filter_order = 4,
  srate,
  silent = FALSE,
  ...
)

## S3 method for class 'eeg_data'
iir_filt(
  data,
  low_freq = NULL,
  high_freq = NULL,
  filter_order = 4,
  silent = FALSE,
  ...
)

## S3 method for class 'eeg_epochs'
iir_filt(
  data,
  low_freq = NULL,
  high_freq = NULL,
  filter_order = 4,
  silent = FALSE,
  ...
)

Arguments

data

Data to be filtered.

...

Parameters passed to S3 methods

low_freq

Low passband edge.

high_freq

High passband edge.

filter_order

Order of the Butterworth filter.

srate

Sampling rate of the signal.

silent

Turns off filtering messages.

Details

low_freq and high_freq are passband edges. Pass low freq or high freq alone to perform high-pass or low-pass filtering respectively. For band-pass or band-stop filters, pass both low_freq and high_freq.

If low_freq < high_freq, bandpass filtering is performed.

If low_freq > high_freq, bandstop filtering is performed.

Note that the signal is first zero-meaned using either channel means or by-channel epoch means.

Methods (by class)

Author(s)

Matt Craddock matt@mattcraddock.com

Examples

1
2
plot_psd(iir_filt(demo_epochs, low_freq = 1, high_freq = 30))
plot_psd(iir_filt(demo_epochs, low_freq = 12, high_freq = 8))

kusumikakd/EEG documentation built on June 28, 2020, 12:30 a.m.