Use water waves as examples. Put something in the water. When you produce a wave, refraction will occur on above the 'something'. But why the frequency in both shallower and deeper part is the same? In addition, the wavelength in the shallower part reduce. Does this means the engery of the wave increase?