gen_padding extended to do the inverse operation: sample elimination if parameter direction is set