# Effects of Timing Noise on Square-Wave
## 2 Methods  
We start with a real periodic modulation signal as the modulation of the NS OEO output,  
\[f(t)=\sum_{n=1}^{\infty}\{a_{n}\cos[n\omega_{0}\big{(}t+\varphi(t)\big{)}]+b_{n} \sin[n\omega_{0}\big{(}t+\varphi(t)\big{)}]\} \tag{1}\]  
with \(\omega_{0}\) the modulation frequency and \(a_{n},b_{n}\in\mathbb{R}\) the Fourier coefficients. Below, we specify the Fourier coefficients for the SW; however, the theoretical treatment in this section applies for a general NS OEO. We omit any possible dc term being of no interest. Note that \(f(t)\) is the amplitude modulation, i.e., slowly varying envelope, of the optical signal and does not include the optical carrier itself. The timing noise is described by \(\varphi(t)\), a random signal of zero mean, \(\langle\varphi(t)\rangle=0\) with \(\langle a(t)\rangle\). The time average of \(a(t)\) is defined by  
\[\langle a(t)\rangle=\lim_{\hat{T}\to\infty}\frac{1}{\hat{T}}\int_{-\hat{T}/2}^ {\hat{T}/2}\!\!dt\ a(t).\]  
The PSD of \(f(t)\) is  
\[S_{f}(\omega)=\lim_{\hat{T}\to\infty}\frac{1}{\hat{T}}\int_{-\hat{T}/2}^{\hat {T}/2}\!\!dt\int_{-\hat{T}/2}^{\hat{T}/2}\!\!\!dt^{\prime}e^{i\omega(t-t^{ \prime})}\mathcal{G}(t,t^{\prime}) \tag{2}\]  
where \(\mathcal{G}(t,t^{\prime})=\langle f(t)f(t^{\prime})\rangle\). As stated above, we will consider the following cases: (A) absence of a reference oscillator; (B) presence of an ideal reference oscillator; and (C) a reference oscillator, though of nonzero bandwidth, whose phase will be permitted to wander over long timescales. In all cases, we assume the ergodic hypothesis, whereby we may freely replace time averages over \(\varphi(t)\) by configuration averages over the random variable. It will be useful to rewrite \(f(t)\) as  
\[f(t)=\frac{1}{2}\sum_{n=1}^{\infty}\Big{\{}c_{n}e^{in\omega_{0}[t+\varphi(t)] }+c_{n}^{\ast}e^{-in\omega_{0}[t+i\varphi(t)]}\Big{\}} \tag{3}\]  
where \(c_{n}=a_{n}-ib_{n}\), whence (see definition of \(\mathcal{G}(t,t^{\prime})\) and Equation (1))  
\[\mathcal{G}(t,t^{\prime}) = \frac{1}{4}\sum_{n,n^{\prime}=1}^{\infty}\Big{[}c_{n}c_{n^{\prime }}e^{i\omega_{0}(nt+n^{\prime}t^{\prime})}\langle e^{i\omega_{0}[n\varphi(t)+n ^{\prime}\varphi(t^{\prime})]}\rangle+c.c. \tag{4}\] \[+c_{n}c_{n^{\prime}}^{\ast}e^{i\omega_{0}(nt-n^{\prime}t^{\prime })}\langle e^{i\omega_{0}[n\varphi(t)-n^{\prime}\varphi(t^{\prime})]}\rangle+ c.c.\Big{]}\]  
where \(c.c.\) denotes the complex conjugate of the preceding term. Next, define the relative and average time variables \(\tau\) and \(T\) such that \(t=T+\frac{\tau}{2}\) and \(t^{\prime}=T-\frac{\tau}{2}\). To proceed, consider \(\langle e^{\pm i\omega_{0}[n\varphi(t)\pm n^{\prime}\varphi(t^{\prime})]}\rangle\),  
\[\langle e^{\pm i\omega_{0}[n\varphi(t)\pm n^{\prime}\varphi(t^{\prime})]} \rangle=\langle e^{\pm i\omega_{0}[n\varphi(T+\tau/2)\pm n^{\prime}\varphi(T- \tau/2)]}\rangle=\langle e^{i\omega_{0}[n\varphi(\tau)\pm n^{\prime}\varphi(0)]}\rangle\]  
since time averages of functions of \(\varphi(t)\) only depend on the relative time since it is a stationary random variable [50]. We have  
\[\mathcal{G}(t,t^{\prime}) = \frac{1}{4}\sum_{n,n^{\prime}=1}^{\infty}\Big{\{}\Big{[}c_{n}c_{ n^{\prime}}e^{i\omega_{0}(n+n^{\prime})T}e^{i\omega_{0}(n-n^{\prime})\tau/2}+c.c. \Big{]}\langle e^{i\omega_{0}[n\varphi(\tau)+n^{\prime}\varphi(0)]}\rangle \tag{5}\] \[+\Big{[}c_{n}c_{n^{\prime}}^{\ast}e^{i\omega_{0}(n-n^{\prime})T} e^{i\omega_{0}(n+n^{\prime})\tau/2}+c.c.\Big{]}\langle e^{i\omega_{0}[n \varphi(\tau)-n^{\prime}\varphi(0)]}\rangle\Big{\}}.\]  
Now consider \(S_{f}(\omega)\), which we can write as  
\[S_{f}(\omega)=\lim_{\hat{T}\to\infty}\frac{1}{\hat{T}}\int_{-\infty}^{\infty}\! \!d\tau\ e^{i\omega\tau}\int_{-\frac{\tau}{2}}^{\frac{\tau}{2}}\!\!dT\ \mathcal{G}(t,t^{\prime}).\]This involves \(\lim_{T\to\infty}\hat{T}^{-1}\int_{-\hat{T}/2}^{\hat{T}/2}\!dT\ e^{i\omega_{0}(n \pm n^{\prime})T}=\delta_{n,\mp n^{\prime}}\).