  We propose a method, based on a Generalized Heisenberg Algebra (GHA), to
reproduce the anharmonic spectrum of diatomic molecules. The theoretical
spectrum generated by GHA allows us to fit the experimental data and to obtain
the dissociation energy for the carbon monoxide molecule. Our outcomes are more
accurate than the standard models used to study molecular vibrations, namely
the Morse and the $q$-oscillator models and comparable to the perturbed Morse
model proposed by Huffaker \cite{hf}, for the first experimental levels. The
dissociation energy obtained here is more accurate than all previous models.
