  In this work, we present a method for measuring the motional state of a
two-level system coupled to a harmonic oscillator. Our technique uses
ultra-narrowband composite pulses on the blue sideband transition to scan
through the populations of the different motional states. Our approach does not
assume any previous knowledge of the motional state distribution and is easily
implemented. It is applicable both inside and outside of the Lamb-Dicke regime.
For higher phonon numbers especially, the composite pulse sequence can be used
as a filter for measuring phonon number ranges. We demonstrate this measurement
technique using a single trapped ion and show good detection results with the
numerically evaluated pulse sequence.
