The problem of estimating the direction of arrival (DoA) of the various sources impinging on a phased array has received considerable attention, in many fields including radar, sonar, radio astronomy and mobile communications. A very efficient computational procedure in the Matrix Pencil (MP) method to compute the one dimensional direction of arrival (1D-DoA) of the signals impinging on the linear array operating in the presence of undesired electromagnetic effects is given in this paper. This procedure reduces the complexity of the computation significantly by using a unitary matrix transformation. This technique is applied directly to the corrected data by applying the transformation matrix to compensate the undesired electromagnetic effects such as mutual coupling between the antenna elements without forming a covariance matrix. A unitary transform can convert the complex matrix to a real matrix along with their eigenvectors and thereby reducing the computational cost at least by a factor of four. Finally, a new technique based on the above procedure is proposed and applied to a planar array to find the two dimensional direction of arrival (2D-DoA). Limited numerical examples are presented to illustrate the performance and accuracy of the proposed techniques.