Revealing the nature of the QPO and its harmonic in GX 339-4 using frequency-resolved spectroscopy