Applies a notch (band-stop) filter to remove power line interference (50 Hz or 60 Hz) and optionally its harmonics.
Usage
notch_filter(
data,
sampling_rate,
notch_freq = 50,
Q = 30,
harmonics = TRUE,
zero_phase = TRUE
)Arguments
- data
EMG signal. Can be a numeric vector (single channel), a matrix (T x M, time x channels), or a list of matrices.
- sampling_rate
Sampling frequency in Hz.
- notch_freq
Frequency to remove in Hz. Default is 50 Hz. Use 60 Hz for regions with 60 Hz power lines (e.g., Americas, Japan).
- Q
Quality factor determining the filter bandwidth. Higher Q = narrower notch. Default is 30.
- harmonics
Logical. If TRUE (default), also removes harmonics (2x, 3x, etc. of notch_freq up to Nyquist frequency).
- zero_phase
Logical. If TRUE (default), applies zero-phase filtering.