In Compton scattering, the wavelength difference of scattered radiation is measured as, as well as calculated by conservation of momentum: $\lambda - \lambda'={\frac{h}{mc}} (1-cos\theta)$
where $\lambda$ is incident photon's wavelength, $\lambda '$ is the scattered photon's wavelength, $\theta$ is the scattered angle.
Which means the photon's frequency will change during scattering.
In X-ray interacts with electron, then the frequency difference can be easily measured, given the mass of electron is small.
Q: then I am confused why frequency of EM waves does NOT change during refraction, as it is macroscopically scattering.
A few guesses of mine:
1.)check my assumption:
1.a)refraction is a kind of scattering. (maybe it is NOT, refraction is some quantum phenomenon?)
or
1.b) I assumed that medium should be homogeneous and linear such that by Maxwell equation the frequency does not change, which is pretty much NOT that case if we look at atoms and electrons.
2.) maybe "frequency does not change" is just an approximation in classical physics? (in a sense refraction has to do with nuclei too, which is much massive than electrons, therefore, the difference will be much harder to measure.) So in real(quantum) world, frequency changes.