Solution and identification of discrete state-space equations via Walsh functions