# Finite-time Fourier transform of a wavefunction

Can someone explain this formula to me? Given a wave packet whose time evolution is $$g(t)$$, a partially resolved spectrum is found by Fourier transforming its overlap with the same wave packet at time $$t=0$$, $$g$$. $$E_T(\omega) = (1/2\pi)\int_{-T}^T \exp(i\omega t) dt \\ = (1/\pi)\sum_n \frac {\sin(E_n/\hbar - \omega)T}{(E_n/\hbar - \omega)}~|\langle g|\psi_n\rangle |^2.$$

I don't understand how the second formula is found.

This is but a sum of cardinal sine functions with peaks at $$\omega = E_n/\hbar$$, for all n. Absorb $$\hbar$$ into the Es out of respect for sanity.
Recall $$|g\rangle=\sum_n |\psi_n\rangle \langle \psi_n|g\rangle, \quad \Longrightarrow \quad |g(t)\rangle=\sum_n |\psi_n\rangle e^{-iE_nt}\langle \psi_n|g\rangle ,$$ so that $$(1/2\pi)\int_{-T}^T \!\!dt ~ e^{i\omega t}\langle g|g(t)\rangle = (1/2\pi)\int_{-T}^T \!\!dt ~ e^{i\omega t}\sum_n e^{-iE_n t}|\langle g|\psi_n\rangle |^2 \\ = (1/\pi)\sum_n\frac{\sin (E_n - \omega)T}{E_n - \omega} ~|\langle g|\psi_n\rangle |^2 ,$$ upon integration.