Numerical simulation of acoustic wave equation in either isotropic or anisotropic media is crucial to seismic modeling, imaging and inversion. Actually, it is the core computation of these highly advanced seismic processing method. However, the conventional finite difference method suffers from severe numerical dispersion error and s-wave artifacts when solving the acoustic wave equation for anisotropic media. In order to do that, we proposed a method to obtain the finite difference coefficients by comparing the numerical dispersion relation and exact dispersion. The method does not rely on the existing numerical method, thus it can obtain the optimal finite difference coefficients in terms of minimum dispersion error. The method has been extended to solve the acoustic wave equation in transversely isotropic (TI) media without s-wave artifacts. Numerical examples show that the method is of high accuracy and efficient.