Apply low-pass filter when down-sampling to avoid aliasing
Just to add a bit more clarification: As Dan said, the current resampling implementation is really not intended for resampling to arbitrary rates, but just to correct the configured sampling rate of the device (so if configured at 100Hz, use 100Hz). The resampling is doing simple linear/nearest interpolation, which is not great when say downsampling by a factor of 2 and beyond without antialiasing filters. Because we ask users to supply the sample rate, it is misleading because gives the impression that we support arbitrary downsampling/upsampling. Looking at the code, I think there's nothing preventing us to just grab the configured sampling rate from the device metadata/headers instead of asking the user (or we can support actual downsampling/upsampling with proper filtering).