How do we define phase difference between waves travelling in opposite directions?

The wikipedia page says that sound waves when reflected at a solid surface show no phase change, but when reflected from a region with lower acoustic impedance, they exhibit a $$180^\circ$$ phase change.

I am not able to understand the meaning of "phase difference" in waves travelling in opposite directions. As far as my understanding, the phase difference is constantly changing? Lets take the example of a sine wave: $$P=P_0 \sin (kx+\omega t)$$. The wave reflected from a wall will have an equation of $$P=P_0 \sin (kx-\omega t + \pi)$$ which can also be written as $$P=P_0 \sin (\omega t-kx)$$.

At any specific time, the phase difference depends on what time you are considering, and similarly, at any specific distance, the phase difference will depend on what distance you are considering.

• Which wikipedia page? Oct 21, 2020 at 18:03
• I added the hyperlink Oct 22, 2020 at 2:09

You are correct that the phase difference between the incoming and reflected waves is not a constant, since it depends on $$x$$. But the phase change of interest is the phase difference right at the reflective boundary, since this is where the reflected wave is generated. The coordinate for this boundary can be placed at $$x=0$$ for convenience, but any fixed $$x$$-coordinate will work.