This function downsamples pupil data by applying an anti-aliasing filter before decimation. Unlike binning, downsampling preserves the original temporal dynamics without averaging within bins.
This function is called by the exposed wrapper downsample()
.
downsample_pupil(x, prev_op, target_fs, plot_freqz, current_fs, rp, rs)
A list containing the downsampled data and the decimated sample rate
A data frame containing pupil data with columns time_secs
and
the previous operation's pupil column
The name of the previous operation's pupil column
The target sampling frequency in Hz after downsampling
A flag to indicate whether to display the filter frequency
response. Defaults to FALSE
The current sampling frequency in Hz. Defaults to NULL
Passband ripple in dB. Defaults to 1
Stopband attenuation in dB. Defaults to 35