diff --git a/doc/freqsim.md b/doc/freqsim.md new file mode 100644 index 0000000..ce568b6 --- /dev/null +++ b/doc/freqsim.md @@ -0,0 +1,51 @@ + +## Frequency simulation + +Model is based on https://www.dsprelated.com/showarticle/973.php + +### Time domain block diagram + +![time domain](freqsim_timedomain.png) + +### Z domain block diagram + +![Z domain](freqsim_zdomain.png) + +## DDMTD Phase detector gain ($K_{PD}$) + +$$ +\begin{align*} + +\Delta tag[n] &= \dfrac{N}{2\pi} \cdot \Delta\theta[n] \\[10pt] +\Delta tag(z) &= \dfrac{N}{2\pi} \cdot \Delta\theta(z) \\[10pt] +\dfrac{\Delta tag(z)}{\Delta \theta(z)} &= \dfrac{N}{2\pi} \\[10pt] +K_{PD} &= \dfrac{N}{2\pi} \\[10pt] + +\end{align*} +$$ + +## Loop Filter + +Low pass biquad filter calculator: https://www.earlevel.com/main/2021/09/02/biquad-calculator-v3/ + +## Si549 DCXO gain ($K_{DCXO}$) + +Consider Si549 as a phase accumulator: +$$ + +\begin{align*} +\theta_{DCXO}[n] &= 2\pi f[n] \cdot T + \theta_{DCXO}[n-1] \\[10pt] +\theta_{DCXO}[n] &= 2\pi \bigg( f_{center} + 0.0001164 \cdot (\text{BASEADPLL} + ADPLL[n]) \cdot \dfrac{f_{center}}{10^6} \bigg) \cdot T_s + \theta_{DCXO}[n-1] \\[10pt] + +\theta_{DCXO}[n] &= \underbrace{ 2\pi \bigg(0.0001164 \cdot \dfrac{f_{center}}{10^6} \cdot T_s \bigg)}_{K_{DCXO}} \cdot ADPLL[n] + + \underbrace{ 2\pi \bigg( f_{center} + 0.0001164 \cdot \text{BASEADPLL} \cdot \dfrac{f_{center}}{10^6} \bigg) }_{f} \cdot T_s + \theta_{DCXO}[n-1] \\[20pt] + +K_{DCXO} &= 2\pi 0.0001164 \cdot \dfrac{f_{center}}{10^6} \cdot T_s \\[10pt] +K_{DCXO} &= 2\pi * 0.0001164 \cdot \dfrac{f_{center}}{10^6} \cdot \dfrac{1}{f_s} \\[10pt] +K_{DCXO} &= 2\pi * 0.0001164 \cdot \dfrac{f_{center}}{10^6} \cdot \dfrac{N}{f_{center}} \\[10pt] +K_{DCXO} &= \dfrac{0.0001164\cdot N\cdot 2\pi}{10^6} \\[10pt] + + +\end{align*} +$$ + diff --git a/doc/freqsim_timedomain.png b/doc/freqsim_timedomain.png new file mode 100644 index 0000000..e729ff6 Binary files /dev/null and b/doc/freqsim_timedomain.png differ diff --git a/doc/freqsim_zdomain.png b/doc/freqsim_zdomain.png new file mode 100644 index 0000000..692cc00 Binary files /dev/null and b/doc/freqsim_zdomain.png differ