Take an observer, who is receiving an electromagnetic wave signal, which is constantly changing. It can be for example from a source of light falling into a black hole, so the observed wavelength is increasing all the time.
The only definition I know is that the wavelength is the distance over which the wave's shape repeats. But to be precise, continuously changing wave does not repeat itself.
So how do we define the wavelength for "an almost sinusoidal" wave? My guess is just to take a small (even infinitesimal?) fraction of the changing wave and match it with a sine function and take the wavelength of that function. Another idea is to average over the wave for example by taking the distance between maxima. But the problem with this method is that then the wavelength won't be a continuous function. Which is the correct way of doing this, especially for an electromagnetic wave?
Thank you!