Minimal functional observer for linear time invariant systems