Question: comment on the code. need to check work Performance of Phase Locked Loop (PLL) You need to simulate the time domain operation of PLL. Refer

comment on the code. need to check work

Performance of Phase Locked Loop (PLL)

You need to simulate the time domain operation of PLL. Refer to the two block diagrams in Fig. 4.26. Consider the linear PLL by ignoring the nonlinear sine phase detector. Use a major lab report format to write the report.

Assume , and .

Use the RF PLL model (Fig. 4.26a) to do the computer simulation of PLL. Assume Hz. So you need to sample to get with to satisfy the sampling theorem. Plot the phase error as a function of (till steady state) for the following cases:

Consider the first order linear PLL with .

Assume , and degrees. Plot the phase error as a function of . Assume , and degrees. Plot the phase error as a function of .

Consider the second order linear PLL with .

Assume , and degrees. Plot the phase error as a function of . Assume , and degrees. Plot the phase error as a function of .

Use the baseband PLL model (Fig. 4.26b) to do the computer simulation of PLL. You need to sample to get by choosing a proper to satisfy the sampling theorem. This depends on the dynamics of . Plot the phase error as a function of (till steady state) for the following cases:

Consider the first order linear PLL with .

Assume , and degrees. Plot the phase error as a function of . Assume , and degrees. Plot the phase error as a function of .

Consider the second order linear PLL with .

Assume , and degrees. Plot the phase error as a function of . Assume , and degrees. Plot the phase error as a function of .

clc

clear

close all

Ts = 0.1; % sampling time

fc = 5; % given frequancy

wc = 2.*pi.*fc; % wc = 2pi fc

phi_deg = 2; % in degrees

phi0 = phi_deg *pi/180;% in radians

% Case 2a) % w0 - wc = 0;

w0 = 0 + wc;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Case i): Formula for H(s) = 1

numSamples = 70; % number of Samples

k = 1:numSamples; t = k.*Ts; % time

theta_e = (w0 - wc).*(1 - exp(-t)) + phi0.*exp(-t);

figure, plot(k, theta_e)

xlabel('k'); ylabel('\theta(kT_s)')

title('1a i): Phase error \theta_e(kT_S) as a function of k, H(s) = 1 and \omega_c - \omega_0 = 0')

grid on

% Case ii): Formula for H(s) = 1/s

numSamples = 200; % number of Samples

k = 1:numSamples; t = k.*Ts; % time

theta_e = (w0 - wc).*sin(t) + phi0.*cos(t);

figure, plot(k, theta_e)

xlabel('k'); ylabel('\theta(kT_s)')

title('1a ii): Phase error \theta_e(kT_S) as a function of k, H(s) = 1/s and \omega_c - \omega_0 = 0')

grid on

% Case 2b) % w0 - wc = 0.1*pi

w0 = 0.1*pi + wc;

% Case i): Formula for H(s) = 1

numSamples = 70; % number of Samples

k = 1:numSamples; t = k.*Ts; % time

theta_e = (w0 - wc).*(1 - exp(-t)) + phi0.*exp(-t);

figure, plot(k, theta_e)

xlabel('k'); ylabel('\theta(kT_s)')

title('1b i): Phase error \theta_e(kT_S) as a function of k, H(s) = 1 and \omega_c - \omega_0 = 0.1\pi')

grid on

% Case ii): Formula for H(s) = 1/s

numSamples = 200; % number of Samples

k = 1:numSamples; t = k.*Ts; % time

theta_e = (w0 - wc).*sin(t) + phi0.*cos(t);

figure, plot(k, theta_e)

xlabel('k'); ylabel('\theta(kT_s)')

title('1b ii): Phase error \theta_e(kT_S) as a function of k, H(s) = 1/s and \omega_c - \omega_0 = 0.1\pi')

grid on

For Part: B

clc

clear

close all

Ts = 0.1; % sampling time

fc = 5; % given frequancy

wc = 2.*pi.*fc; % wc = 2pi fc

phi_deg = 2; % in degrees

phi0 = phi_deg *pi/180;% in radians

% Case 2a) % w0 - wc = 0;

w0 = 0 + wc;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Case i): Formula for H(s) = 1

numSamples = 70; % number of Samples

k = 1:numSamples; t = k.*Ts; % time

syms s

theta_e_s = (w0 - wc).*(s/(s + 1)) + phi0.*(1/(s + 1));

theta_e_t = ilaplace(theta_e_s);

theta_e = eval(subs(theta_e_t, t));

figure, plot(k, theta_e)

xlabel('k'); ylabel('\theta(kT_s)')

title('2a i): Phase error \theta_e(kT_S) as a function of k, H(s) = 1 and \omega_c - \omega_0 = 0')

grid on

% Case ii): Formula for H(s) = 1/s

numSamples = 200; % number of Samples

k = 1:numSamples; t = k.*Ts; % time

syms s

theta_e_s = (w0 - wc).*(s.^2/(s.^2 + 1)) + phi0.*(s/(s.^2 + 1));

theta_e_t = ilaplace(theta_e_s);

theta_e = eval(subs(theta_e_t, t));

figure, plot(k, theta_e)

xlabel('k'); ylabel('\theta(kT_s)')

title('2a ii): Phase error \theta_e(kT_S) as a function of k, H(s) = 1/s and \omega_c - \omega_0 = 0')

grid on

% Case 2b) % w0 - wc = 0.1*pi

w0 = 0.1*pi + wc;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Case i): Formula for H(s) = 1

numSamples = 70; % number of Samples

k = 1:numSamples; t = k.*Ts; % time

syms s

theta_e_s = (w0 - wc).*(s/(s + 1)) + phi0.*(1/(s + 1));

theta_e_t = ilaplace(theta_e_s);

theta_e = eval(subs(theta_e_t, t));

figure, plot(k, theta_e)

xlabel('k'); ylabel('\theta(kT_s)')

title('2b i): Phase error \theta_e(kT_S) as a function of k, H(s) = 1 and \omega_c - \omega_0 = 0.1\pi')

grid on

% Case ii): Formula for H(s) = 1/s

numSamples = 200; % number of Samples

k = 1:numSamples; t = k.*Ts; % time

syms s

theta_e_s = (w0 - wc).*(s.^2/(s.^2 + 1)) + phi0.*(s/(s.^2 + 1));

theta_e_t = ilaplace(theta_e_s);

theta_e = eval(subs(theta_e_t, t));

figure, plot(k, theta_e)

xlabel('k'); ylabel('\theta(kT_s)')

title('2b ii): Phase error \theta_e(kT_S) as a function of k, H(s) = 1/s and \omega_c - \omega_0 = 0.1\pi')

grid on

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!