InSAR phase measurements are relative, ambiguous due to 2π wrapping, and affected by atmospheric and other noise sources. For many real-world applications unambiguous displacement measurements are necessary. Currently available methods for extracting time series of surface displacement, start with unwrapping in time or space domain. We present a new extended Kalman filtering approach to phase unwrapping, which resolves the 2π ambiguity in a computationally efficient way. Also this algorithm can easily be expanded to use all the data available in space and time dimensions. Several modifications are made to the standard EKF for phase unwrapping. Hence we call our new algorithm as optimized Kalman (OK) filter.