Functional observer design using the direct method for discrete time-varying linear systems