Ballistic rectification based on inhomogeneous magnetic stray fields