iir
function takes a multichannel signal and applies an IIR filter to
the signal.
iir(df, sr, cutoff_freq, order = 4, type = "high", filter_type = "butter")
df  dataframe. The input multichannel signal. The first column is timestamps in POSXlct format. The rest columns are signal values. 

sr  number. Sampling rate in Hz of the input signal. 
cutoff_freq  number or numerical vector. The cutoff frequencies in Hz.
If the IIR filter is a bandpass or bandstop filter, it will be a 2element
numerical vector specifying the low and high end cutoff frequencies

order  number. The order of the filter. Default is 4. 
type  string. Filtering type, one of "low" for a lowpass filter, "high" for a highpass filter, "stop" for a stopband (bandreject) filter, or "pass" for a passband filter. 
filter_type  string. IIR filter type, one of "butter" for butterworth filter, "chebyI" for Chebyshev Type I filter, or "ellip" for Elliptic filter. 
dataframe. Filtered signal.
This function filters the input multichannel signal by applying an IIR
filter. See
wiki for the
explanation of the filter. The implementations of IIR filters can be found in
butter
, cheby1
, and ellip
.
For Chebyshev Type I, Type II and Elliptic filter, the passband ripple is fixed to be 0.05 dB. For Elliptic filter, the stopband ripple is fixed to be 50dB.
This function has been used as the main filtering method in MIMSunit algorithm. Specifically, it uses a 0.5  5 Hz bandpass butterworth filter during filtering.
Other filtering functions:
bandlimited_interp()
,
bessel()
,
remove_average()
# Use sample data df = sample_raw_accel_data # View input illustrate_signal(df, plot_maxed_out_line = FALSE)# Apply filtering that uses the same setting as in MIMSunit algorithm output = iir(df, sr=80, cutoff_freq=c(0.2, 5), type='pass') # View output illustrate_signal(output, plot_maxed_out_line = FALSE)