synchronization

A Digital Communications Synchronization and PLLs Function Module

A collection of useful functions when studying PLLs and synchronization and digital comm

Copyright (c) March 2017, Mark Wickert All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.

sk_dsp_comm.synchronization.DD_carrier_sync(z, M, BnTs, zeta=0.707, mod_type='MPSK', type=0, open_loop=False)[source]

z_prime,a_hat,e_phi = DD_carrier_sync(z,M,BnTs,zeta=0.707,type=0) Decision directed carrier phase tracking

z = complex baseband PSK signal at one sample per symbol M = The PSK modulation order, i.e., 2, 8, or 8.

BnTs = time bandwidth product of loop bandwidth and the symbol period,

thus the loop bandwidth as a fraction of the symbol rate.

zeta = loop damping factor type = Phase error detector type: 0 <> ML, 1 <> heuristic

z_prime = phase rotation output (like soft symbol values)
a_hat = the hard decision symbol values landing at the constellation

values

e_phi = the phase error e(k) into the loop filter

Ns = Nominal number of samples per symbol (Ts/T) in the carrier

phase tracking loop, almost always 1

Kp = The phase detector gain in the carrier phase tracking loop;

This value depends upon the algorithm type. For the ML scheme described at the end of notes Chapter 9, A = 1, K 1/sqrt(2), so Kp = sqrt(2).

Mark Wickert July 2014 Updated for improved MPSK performance April 2020 Added experimental MQAM capability April 2020

Motivated by code found in M. Rice, Digital Communications A Discrete-Time Approach, Prentice Hall, New Jersey, 2009. (ISBN 978-0-13-030497-1).

sk_dsp_comm.synchronization.NDA_symb_sync(z, Ns, L, BnTs, zeta=0.707, I_ord=3)[source]
z = complex baseband input signal at nominally Ns samples

per symbol

Ns = Nominal number of samples per symbol (Ts/T) in the symbol

tracking loop, often 4

BnTs = time bandwidth product of loop bandwidth and the symbol period,

thus the loop bandwidth as a fraction of the symbol rate.

zeta = loop damping factor

I_ord = interpolator order, 1, 2, or 3

e_tau = the timing error e(k) input to the loop filter

Kp = The phase detector gain in the symbol tracking loop; for the

NDA algoithm used here always 1

Mark Wickert July 2014

Motivated by code found in M. Rice, Digital Communications A Discrete-Time Approach, Prentice Hall, New Jersey, 2009. (ISBN 978-0-13-030497-1).

sk_dsp_comm.synchronization.PLL1(theta, fs, loop_type, Kv, fn, zeta, non_lin)[source]

Baseband Analog PLL Simulation Model

Parameters:
  • theta – input phase deviation in radians

  • fs – sampling rate in sample per second or Hz

  • loop_type – 1, first-order loop filter F(s)=K_LF; 2, integrator with lead compensation F(s) = (1 + s tau2)/(s tau1), i.e., a type II, or 3, lowpass with lead compensation F(s) = (1 + s tau2)/(1 + s tau1)

  • Kv – VCO gain in Hz/v; note presently assume Kp = 1v/rad and K_LF = 1; the user can easily change this

  • fn – Loop natural frequency (loops 2 & 3) or cutoff frquency (loop 1)

  • zeta – Damping factor for loops 2 & 3

  • non_lin – 0, linear phase detector; 1, sinusoidal phase detector

Returns:

theta_hat = Output phase estimate of the input theta in radians, ev = VCO control voltage, phi = phase error = theta - theta_hat

Notes

Alternate input in place of natural frequency, fn, in Hz is the noise equivalent bandwidth Bn in Hz.

Mark Wickert, April 2007 for ECE 5625/4625 Modified February 2008 and July 2014 for ECE 5675/4675 Python version August 2014

sk_dsp_comm.synchronization.PLL_cbb(x, fs, loop_type, Kv, fn, zeta)[source]

Baseband Analog PLL Simulation Model

Parameters:
  • x – input phase deviation in radians

  • fs – sampling rate in sample per second or Hz

  • loop_type – 1, first-order loop filter F(s)=K_LF; 2, integrator with lead compensation F(s) = (1 + s tau2)/(s tau1), i.e., a type II, or 3, lowpass with lead compensation F(s) = (1 + s tau2)/(1 + s tau1)

  • Kv – VCO gain in Hz/v; note presently assume Kp = 1v/rad and K_LF = 1; the user can easily change this

  • fn – Loop natural frequency (loops 2 & 3) or cutoff frequency (loop 1)

  • zeta – Damping factor for loops 2 & 3

Returns:

theta_hat = Output phase estimate of the input theta in radians, ev = VCO control voltage, phi = phase error = theta - theta_hat

Mark Wickert, April 2007 for ECE 5625/4625 Modified February 2008 and July 2014 for ECE 5675/4675 Python version August 2014

sk_dsp_comm.synchronization.phase_step(z, ns, p_step, n_step)[source]

Create a one sample per symbol signal containing a phase rotation step Nsymb into the waveform.

Parameters:
  • z – complex baseband signal after matched filter

  • ns – number of sample per symbol

  • p_step – size in radians of the phase step

  • n_step – symbol sample location where the step turns on

Returns:

the one sample symbol signal containing the phase step

Mark Wickert July 2014

sk_dsp_comm.synchronization.time_step(z, ns, t_step, n_step)[source]

Create a one sample per symbol signal containing a phase rotation step Nsymb into the waveform.

Parameters:
  • z – complex baseband signal after matched filter

  • ns – number of sample per symbol

  • t_step – in samples relative to Ns

  • n_step – symbol sample location where the step turns on

Returns:

the one sample per symbol signal containing the phase step

Mark Wickert July 2014