Digital spatial filtering, a state variable approach