<< Chapter < Page Chapter >> Page >
d J C ( θ ) d θ avg d LPF { r ( k T s ) cos ( 2 π f 0 k T s + θ ) } 2 d θ = 2 avg { LPF { r ( k T s ) cos ( 2 π f 0 k T s + θ ) } · d LPF { r ( k T s ) cos ( 2 π f 0 k T s + θ ) } d θ } 2 avg { LPF { r ( k T s ) cos ( 2 π f 0 k T s + θ ) } · LPF { d r ( k T s ) cos ( 2 π f 0 k T s + θ ) } d θ } = - 2 avg { LPF { r ( k T s ) cos ( 2 π f 0 k T s + θ ) } · LPF { r ( k T s ) sin ( 2 π f 0 k T s + θ ) } } .

Accordingly, an implementable version of the Costas loop can be built as

θ [ k + 1 ] = θ [ k ] + μ d J C ( θ ) d θ θ = θ [ k ] = θ [ k ] - μ avg { LPF { r ( k T s ) cos ( 2 π f 0 k T s + θ [ k ] ) } LPF { r ( k T s ) sin ( 2 π f 0 k T s + θ [ k ] ) } } .

This is diagrammed in [link] , leaving off the first (or outer) averaging operation (as is often done),since it is redundant given the averaging effect of the two LPFs and the averaging effect inherent in thesmall stepsize update. With this averaging removed, the algorithm is

θ [ k + 1 ] = θ [ k ] - μ LPF { r ( k T s ) cos ( 2 π f 0 k T s + θ [ k ] ) } LPF { r ( k T s ) sin ( 2 π f 0 k T s + θ [ k ] ) } .

Basically, there are two paths. The upper path modulates by a cosine and then lowpass filters to create [link] , while the lower path modulates by a sine waveand then lowpass filters to give - s ( k T s ) sin ( Φ - θ ) . These combine to give the equation update, which is integratedto form the new estimate of the phase. The latest phase estimate is then fed back (this is the “loop”in “Costas loop”) into the oscillators, and the recursion proceeds.

Suppose that a 4-PAM transmitted signal r is created as in pulrecsig.m with carrier frequency fc=1000 . The Costas loop phase tracking method [link] can be implemented in much the same way that the PLL was implemented in pllconverge.m .

r=rsc;                                    % rsc is from pulrecsig.m fl=500; ff=[0 .01 .02 1]; fa=[1 1 0 0];h=firpm(fl,ff,fa);                        % LPF design mu=.003;                                  % algorithm stepsizef0=1000;                                  % assumed freq. at receiver theta=zeros(1,length(t)); theta(1)=0;     % initialize estimate vectorzs=zeros(1,fl+1); zc=zeros(1,fl+1);       % initialize buffers for LPFs for k=1:length(t)-1                       % z's contain past fl+1 inputs  zs=[zs(2:fl+1), 2*r(k)*...              sin(2*pi*f0*t(k)+theta(k))];   zc=[zc(2:fl+1), 2*r(k)*...             cos(2*pi*f0*t(k)+theta(k))];  lpfs=fliplr(h)*zs'; lpfc=fliplr(h)*zc';  % new output of filters   theta(k+1)=theta(k)-mu*lpfs*lpfc;       % algorithm updateend
costasloop.m simulate costas loop with input from pulrecsig.m (download file)
The Costas loop is a phase tracking algorithm based on the performance function Equation 27. The input need not be preprocessed (as is required by the PLL).
The Costas loop is a phase tracking algorithm based on the performance function [link] . The input need not be preprocessed (as is required by the PLL).

Typical output of costasloop.m is shown in [link] , which shows the evolution of the phase estimates for 50 different starting values theta(1) . A number of these converge to Φ = - 0 . 8 , and a number to nearby π multiples. These stationary points occur at all the maxima of the error surface (the bottom plot in [link] ).

When the frequency is not exactly known, the phase estimates of the Costas algorithm try to follow. For example, in [link] , the frequency of the carrier is f c = 1000 , while the assumed frequency at the receiver was f 0 = 1000 . 1 . Fifty different starting points are shown, and in all cases, the estimates converge to a line. "Frequency Tracking" shows how this linear phase motion can be used to estimate the frequency difference.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Software receiver design. OpenStax CNX. Aug 13, 2013 Download for free at http://cnx.org/content/col11510/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Software receiver design' conversation and receive update notifications?

Ask