system
Given the following post, respond as if you're commenting on Reddit:
human
Where does the energy come from to cause blue shift/why is there not any extra energy?

So, as I understand it, if light is emitted with a certain wavelength, then the energy of each photon can be calculated (as h x f1 if h is plank's constant and f1 is the frequency of the light emitted). And when the light is detected the energy of each photon is h x f2, where f2 is the frequency of the light received. 

However if the emitter and detector are moving towards each other, the light will be blue-shifted and therefore f2 will be larger at the receiver, meaning that the photon will have more energy at the receiver. 

So basically what I'm asking is where that energy comes from, of if there's something wrong with my picture of the situation which explains why the photon doesn't need to gain energy from anywhere.
gpt
Basically, energy is not conserved when considering the same thing from different reference frames. Imagine a bullet instead of a photon: in the reference frame of the gun, a bullet emitted from it will have enough energy to go through a person. In another reference frame moving very fast away from the gun, the bullet will not have enough energy to that. Both reference frames are valid, but in only one can the bullet pierce someone.