How to uniquely identify phase difference between harmonics?
i am assuming this is a periodic (or quasi-periodic) function.  also seems like the signal is a musical tone.  periodic signals have a period, $P$, and the reciprocal of that period is the fundamental frequency; $f_0 \triangleq \frac{1}{P}$

or, as angular frequency; $\omega_0 = 2 \pi f_0 = \frac{2 \pi}{P}$ .

the periodic signal is $x(t)$ where

$$ x(t+P) = x(t)  \qquad \forall t \in \mathbb{R} $$

it can be represented as a Fourier series

$$ \begin{align}
x(t) \ &amp;= \ a_0 \ + \ 2 \sum_{k=1}^{\infty} a_k \cos(k \omega_0 t) - b_k \sin(k \omega_0 t) \\
 &amp;= \ a_0 \ + \ 2 \sum_{k=1}^{\infty} a_k \frac{e^{j k \omega_0 t} + e^{-j k \omega_0 t}}{2} \ - \ b_k \frac{e^{j k \omega_0 t} - e^{-j k \omega_0 t}}{2j} \\
 &amp;= \ a_0 \ + \ \sum_{k=1}^{\infty} (a_k + jb_k) e^{j k \omega_0 t} \ + \ (a_k - jb_k) e^{-j k \omega_0 t} \\
 &amp;= \ \sum_{k=-\infty}^{\infty} c_k \ e^{j k \omega_0 t} \\
\end{align} $$

where

$$ c_k =
\begin{cases}
a_{-k} - jb_{-k}, &amp; \quad \text{for } k &lt; 0 \\
a_0, &amp; \quad\quad k = 0 \\
a_k + jb_k, &amp; \quad\quad k &gt; 0 
\end{cases} $$

and, going in the other direction,

$$ \begin{array}{lcl}
a_0 &amp; = &amp; c_0 \\
a_k &amp; = &amp; \Re\{c_k \} \quad\quad \text{for } k&gt;0\\
b_k &amp; = &amp; \Im\{c_k \} \quad\quad\quad k&gt;0
\end{array} $$

note that for real $a_k$ and real $b_k$, then

$$ c_{-k} = c_k^* = \text{"complex conjugate of } c_k \text{ "}$$

it's easier to get $c_k$ from $x(t)$ and then compute $a_k$ and $b_k$ from the $c_k$ which is:

$$ c_k = \tfrac{1}{P} \int\limits_{t_0}^{t_0+P} x(t) \, e^{-j k \omega_0 t} \, \mathrm{d}t \qquad \text{for any } t_0 \in \mathbb{R}$$

you can uniquely define the phase of overtones (or harmonics apart from the fundamental) with reference to the fundamental if there is any energy at the fundamental.  (it is not always the case that a periodic signal has non-zero energy in its own fundamental frequency.)

now it's also true that:

$$ \begin{align}
x(t) \ &amp;= \ \sum_{k=-\infty}^{\infty} c_k \ e^{j k \omega_0 t} \\
 &amp;= \ a_0 \ + \ 2 \sum_{k=1}^{\infty} a_k \cos(k \omega_0 t) - b_k \sin(k \omega_0 t) \\
 &amp;= \ a_0 \ + \sum_{k=1}^{\infty} r_k \cos(k \omega_0 t + \phi_k) \\
\end{align} $$

where

$$ \begin{align}
r_k &amp;= 2 \big| a_k + j\,b_k \big|  \\
 &amp;= 2 \sqrt{a_k^2 + b_k^2}  \\
\\
\phi_k &amp;= \arg \{a_k + j\,b_k \}  \\
 &amp;= \operatorname{atan2}(b_k, a_k)  \\
\end{align} $$

now, the phases of all of the harmonics are relative to some time $t=0$, but that reference time can be defined in such a way that the phase of the fundamental is zero.

let 

$$\begin{align}
 \tilde{x}(t) \ &amp;\triangleq \ x(t - \tfrac{\phi_1}{\omega_0}) \\
 &amp;= \ a_0 \ +  \sum_{k=1}^{\infty} r_k \cos \big(k \omega_0 (t - \tfrac{\phi_1}{\omega_0}) + \phi_k \big) \\
 &amp;= \ a_0 \ +  \sum_{k=1}^{\infty} r_k \cos(k \omega_0 t + \phi_k - k\phi_1) \\
 &amp;= \ a_0 \ +  \sum_{k=1}^{\infty} r_k \cos(k \omega_0 t + \tilde{\phi}_k) \\
\end{align} $$

where $ \tilde{\phi}_k \triangleq \phi_k - k\phi_1 $.

you can see that $\tilde{\phi}_1 = 0$, that we defined our origin of $t$ so that the phase of the fundamental (when $k=1$) is 0.  then all of the other harmonics have their phases referenced to that "first harmonic" or fundamental.  the only problem is that the amplitude of that fundamental must not be zero.  $r_1 \ne 0$ so that the reference phase, $\phi_1 = \arg \{a_1 + j\,b_1 \}$, can be determined.