  Motivated by the recent rapid development of the field of quantum gases in
optical lattices, we present a comprehensive study of the spectrum of ultracold
atoms in a one-dimensional optical lattice subjected to a periodic lattice
modulation. Using the time-dependent density-matrix renormalization group
method, we study the dynamical response due to lattice modulations in different
quantum phases of the system with varying density. For the Mott insulating
state, we identify several excitation processes, which provide important
information about the density profile of the gases. For the superfluid, the
dynamical response can be well described in a local density approximation. This
simplification can be valuable in understanding the strong-correlated
superfluid in a slow-varying harmonic potential. All these spectroscopic
features of an inhomogeneous system can be used as a test for the validity of
the Bose-Hubbard model in a parabolic trapping potential.
