Filter of bad_channels can be a function_handle