Skip to contents

Native IIR notch (module 20); previously wrapped the signal package's iirnotch / filtfilt. Falls back to a stop with NotYetPorted if signal is unavailable.

Usage

morie_dsp_notch(x, freq, fs, q = 30)

Arguments

x

Numeric vector.

freq

Notch centre frequency (Hz).

fs

Sampling frequency (Hz).

q

Quality factor. Default 30.

Value

Filtered vector, length(x).

References

Rangayyan & Krishnan (2015), Ch. 3, sec. 3.7.

Examples

fs <- 1000
t <- seq(0, (fs - 1) / fs, length.out = fs)
x <- sin(2 * pi * 10 * t) + 0.5 * sin(2 * pi * 60 * t)
y <- morie_dsp_notch(x, freq = 60, fs = fs)
length(y)
#> [1] 1000