A linear gate and integrator