Calculating the instantaneous period of a wave I have a set of data which represents slightly imperfect waves of varying amplitudes and periods. I wish to calculate the instantaneous period of the wave around any point within this data set - simply finding the local minima and maxima representing each individual wave and calculating the frequency of these is not precise enough for my needs.

Is there a known algorithm that can achieve this? Even better, an existing implementation of this algorithm? I am currently programming in R, but am willing to switch if needed.

n.b. if this is the wrong StackExchange site for this question, please direct me to a better one.
The instantaneous frequency of a wave is defined as $f(t) = \frac{1}{2\pi}\frac{d\phi}{dt}$ where $\phi$ is the instantaneous phase. See the Wikipedia page on Instantaneous Frequency.

Presumably you have discrete data, in which case you need to estimate $\phi$ and its derivative numerically. 

This isn't an entirely meaningful measure, since it doesn't make very much sense to ascribe a frequency to a non-periodic function, but nonetheless there does seem to be a convention for it.

Let me close by saying that I don't consider this a TCS problem. It is firmly in signal processing territory, and so I wouldn't consider here the ideal venue for such questions.