  We obtain the spectrum of bound states for a modified P\"oschl-Teller and
square potential wells in the nonlinear Schr\"odinger equation. For a fixed
norm of bound states, the spectrum for both potentials turns out to consist of
a finite number of multi-node localized states. We use modulational instability
analysis to derive the relation that gives the number of possible localized
states and the maximum number of nodes in terms of the width of the potential.
Soliton scattering by these two potentials confirmed the existence of the
localized states which form as trapped modes. Critical speed for quantum
reflection was calculated using the energies of the trapped modes.
