  We propose a numerical method to solve an inverse source problem of computing
the initial condition of hyperbolic equations from the measurements of Cauchy
data. This problem arises in thermo- and photo- acoustic tomography in a
bounded cavity, in which the reflection of the wave makes the widely-used
approaches, such as the time reversal method, not applicable. In order to solve
this inverse source problem, we approximate the solution to the hyperbolic
equation by its Fourier series with respect to a special orthogonal basis of
$L^2$. Then, we derive a coupled system of elliptic equations for the
corresponding Fourier coefficients. We solve it by the quasi-reversibility
method. The desired initial condition follows. We rigorously prove the
convergence of the quasi-reversibility method as the noise level tends to 0.
Some numerical examples are provided. In addition, we numerically prove that
the use of the special basic above is significant.
