notch_filter {ravetools} | R Documentation |
Apply 'Notch' filter
Description
Apply 'Notch' filter
Usage
notch_filter(
s,
sample_rate,
lb = c(59, 118, 178),
ub = c(61, 122, 182),
domain = 1
)
Arguments
s |
numerical vector if |
sample_rate |
sample rate |
lb |
filter lower bound of the frequencies to remove |
ub |
filter upper bound of the frequencies to remove;
shares the same length as |
domain |
|
Details
Mainly used to remove electrical line frequencies
at 60, 120, and 180 Hz
.
Value
filtered signal in time domain (real numerical vector)
Examples
time <- seq(0, 3, 0.005)
s <- sin(120 * pi * time) + rnorm(length(time))
# Welch periodogram shows a peak at 60Hz
pwelch(s, 200, plot = 1, log = "y")
# notch filter to remove 60Hz
s1 <- notch_filter(s, 200, lb = 59, ub = 61)
pwelch(s1, 200, plot = 2, log = "y", col = "red")
[Package ravetools version 0.1.7 Index]