# Error with phase noise to jitter calculation

I'm trying to get the jitter for an oscillator. The nominal frequency $f_0$ is 10 MHz, I'm integrating from 1 Hz to 100 kHz. The specifications are given as "RF Output Phase Noise (SSB)", in dBc/Hz.

The formula I'm using is:

$x_{RMS}=\frac{1}{2 \pi f_0} \sqrt{\int_{1 Hz}^{10^5 Hz} 2 \mathscr{L} (f) df}$

The corresponding python code is:

import numpy as np

f  = np.array([1e0,1e1, 1e2, 1e3, 1e4, 1e5])
Lf = np.array([-50,-70,-113,-128,-135,-140])
f0 = 10e6

Sphi = 2*10.0**(Lf/10.0)

jitter = 1.0/2/np.pi/f0 * np.sqrt(np.trapz(Sphi,f))

print jitter * 1e12,
print 'ps'

raw_input('done')


The result is:

159.083754236 ps
done


Two different online tools gave me an identical results of 68.66 ps, and this is also closer to what I'm expecting from lab data.

Am I using the formula incorrectly? Or maybe I made a mistake in my code?

It turns out that the trapezoidal method is inaccurate when used on the linear data. The piece-wise linear approximation is only accurate on the log-log graph. Since I havn't found a nice detailed source on the subject, I did the calulations.

Function $\mathscr{L}(f)$ passing through $(f_1,\mathscr{L}_1)$ and $(f_2,\mathscr{L}_2)$, as a line on a log-log figure: $$log_{10}(\mathscr{L}(f))=\frac{1}{10}\frac{\mathscr{L}_{2|dBc}-\mathscr{L}_{1|dBc}}{log_{10}(f_2)-log_{10}(f_1)}log_{10}(f)+\frac{1}{10}\frac{log_{10}(f_2)\mathscr{L}_{1|dBc}-log_{10}(f_1)\mathscr{L}_{2|dBc}}{log_{10}(f_2)-log_{10}(f_1)}$$ This can be rewritten as: \begin{aligned} \mathscr{L}(f) &= 10^{a \cdot log_{10}(f)+b}=10^{log_{10}(f^a)}10^b=f^a10^b \\ a &= \frac{\mathscr{L}_{2|dBc}-\mathscr{L}_{1|dBc}}{10(log_{10}(f_2)-log_{10}(f_1))} \qquad b = \frac{log_{10}(f_2)\mathscr{L}_{1|dBc}-log_{10}(f_1)\mathscr{L}_{2|dBc}}{10(log_{10}(f_2)-log_{10}(f_1))} \end{aligned} Integration of $\mathscr{L}(f)$ from $f_1$ to $f_2$: $$\int_{f_1}^{f_2} 2\mathscr{L}(f)df=2\cdot10^b\int_{f_1}^{f_2} f^a df=2\frac{f_2^{a+1}-f_1^{a+1}}{a+1}10^b$$ With multiple segments: \begin{aligned} &\int 2\mathscr{L}(f)df = 2 \sum \frac{f_{i+1}^{a_i+1}-f_i^{a_i+1}}{a_i+1}10^{b_i} \\ a_i &= \frac{\mathscr{L}_{i+1|dBc}-\mathscr{L}_{i|dBc}}{10(log_{10}(f_{i+1})-log_{10}(f_i))} \qquad b_i = \frac{log_{10}(f_{i+1})\mathscr{L}_{i|dBc}-log_{10}(f_i)\mathscr{L}_{i+1|dBc}}{10(log_{10}(f_{i+1})-log_{10}(f_i))} \end{aligned}

The python code is changed to:

import numpy as np

f  = np.array([1e0,1e1, 1e2, 1e3, 1e4, 1e5])
Lf = np.array([-50,-70,-113,-128,-135,-140])
f0 = 10e6

# f_{i}, f_{i+1}, L_{i}, L_{i+1}
fi = f[:-1]
fip1 = f[1:]
Li = Lf[:-1]
Lip1 = Lf[1:]

ai = (Lip1-Li) / (np.log10(fip1) - np.log10(fi)) /10.0
bi = (Li*np.log10(fip1)-Lip1*np.log10(fi)) / (np.log10(fip1) - np.log10(fi)) /10.0
Sphi = 2*np.sum(  10.0**(bi) * (fip1**(ai+1)-fi**(ai+1))/(ai+1) )

jitter = 1.0/2/np.pi/f0 * np.sqrt(Sphi)

print jitter * 1e12,
print 'ps'

raw_input('done')


The output is 68.66 ps, it matches the online tools.

I'm still interested if somebody have a more complete source on this subject or a simpler method.