A theory of the energy dependent STM image of a charge density wave