Skip to content

Commit

Permalink
1st order PLL noise analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
arnauochoa committed Dec 27, 2020
1 parent dd0de80 commit 44f9bc9
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 22 deletions.
10 changes: 5 additions & 5 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
fIF = 4.348e6; % Hz Intermediate frequency
fs = 23.104e6; % Hz Sampling frequency
B = fs/2; % Hz RF front-end BW
Bl = 60; % Hz Equivalent bandwidth of the PLL
Bl = 30; % Hz Equivalent bandwidth of the PLL
tI = 1e-3; % sec Integration time
sLength = duration/tR * prnLength; % Signal length in code samples
tC = tR/prnLength;
tVec = 0:1/fs:duration-1/fs; % Vector of time
isFirstOrder = 0;
Kpll = 0.05;
thresHist = 1200e-3; % sec Threshold to compute the variance of Vd
isFirstOrder = 1;
Kpll = 0.01; % Kpll = [0.01 0.05 0.1 0.5]
thresHist = 500e-3; % sec Threshold to compute the variance of Vd

%% Generation of synthetic signal
A = 1; % mW/s Amplitude of the synthetic signal
cno = 60; % dbHz C/N0 of the synthetic signal
cno = 60; % dbHz C/N0 of the synthetic signal cn0 = [35 40 45 50 60];
phi = pi/3;
% phi = linspace(0, 2*pi, length(tVec));
% phi = sin(2*pi*5*tVec);
Expand Down
50 changes: 33 additions & 17 deletions plotsNoise.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
clear all; close all; clc;
%% Noise charactization plots
%% Noise charactization plots: First Order PLL
Kpll = [0.01 0.05 0.1 0.5];
cn0 = [35 40 45 50 60];

noisePowerK001 = [652.237448 183.196869 52.791025 16.658201 1.599654];
thresholdK001 = [500 500 500 500 500];
noisePowerK005 = [];
thresholdK005 = [];
noisePowerK01 = [];
thresholdK01 = [];
noisePowerK05 = [];
thresholdK05 = [];





%% Noise charactization plots: Second Order PLL
Bl = [10 20 30 40 50 60];
cn0 = [35 40 45 50 60];
noisePowerBl10 = [1090.278549 271.844448 80.020182 24.870782 2.447463];
Expand All @@ -16,27 +32,27 @@
noisePowerBl60 = [1237.519903 281.098273 87.126546 26.700544 2.683888];
thresholdBl60 = [500 500 500 500 500];

noisePower = [noisePowerBl10' noisePowerBl20' noisePowerBl30' noisePowerBl40' noisePowerBl50' noisePowerBl60'];
noisePowerdB = 10*log10([noisePowerBl10' noisePowerBl20' noisePowerBl30' noisePowerBl40' noisePowerBl50' noisePowerBl60']);
noiseThreshold = [thresholdBl10' thresholdBl20' thresholdBl30' thresholdBl40' thresholdBl50' thresholdBl60'];

[BL,CN0] = meshgrid(Bl,cn0);

figure; plot(cn0, noisePowerBl10, ...
cn0, noisePowerBl20, ...
cn0, noisePowerBl30, ...
cn0, noisePowerBl40, ...
cn0, noisePowerBl50, ...
cn0, noisePowerBl60);
xlabel('CN0'); ylabel('Noise Power (W/Hz)');
figure; plot(cn0, 10*log10(noisePowerBl10), ...
cn0, 10*log10(noisePowerBl20), ...
cn0, 10*log10(noisePowerBl30), ...
cn0, 10*log10(noisePowerBl40), ...
cn0, 10*log10(noisePowerBl50), ...
cn0, 10*log10(noisePowerBl60));
xlabel('CN0'); ylabel('Noise Power (dB)');
legend('BW = 10 Hz', 'BW = 20 Hz', 'BW = 30 Hz', 'BW = 40 Hz', 'BW = 50 Hz', 'BW = 60 Hz')
title('Comparison of noise PSD at discriminator output');

figure; plot(Bl, noisePower(1,:), ...
Bl, noisePower(2,:), ...
Bl, noisePower(3,:), ...
Bl, noisePower(4,:), ...
Bl, noisePower(5,:));
xlabel('BW (Hz)'); ylabel('Noise Power (W/Hz)');
figure; plot(Bl, noisePowerdB(1,:), ...
Bl, noisePowerdB(2,:), ...
Bl, noisePowerdB(3,:), ...
Bl, noisePowerdB(4,:), ...
Bl, noisePowerdB(5,:));
xlabel('BW (Hz)'); ylabel('Noise Power (dB)');
legend('CN0 = 35', 'CN0 = 40', 'CN0 = 45', 'CN0 = 50', 'CN0 = 60')
title('Comparison of noise PSD at discriminator output');

Expand All @@ -51,10 +67,10 @@
title('Convergence time comparison');

figure;
[~,ph] = contourf(BL, CN0, noisePower);
[~,ph] = contourf(BL, CN0, noisePowerdB);
set(ph,'LineColor','none')
grid off;
xlabel('Bandwidth (Hz)'); ylabel('CN0');
k = colorbar;
set(get(k,'label'),'string', 'Noise Power');
set(get(k,'label'),'string', 'Noise Power (dB)');
title('Noise Power at Discriminator Output');
76 changes: 76 additions & 0 deletions plotsNoise.m~
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
clear all; close all; clc;
%% Noise charactization plots: First Order PLL
Kpll = [0.01 0.05 0.1 0.5];
cn0 = [35 40 45 50 60];

noisePowerK001 = [666.9451 ];
thresholdK001 = [];
noisePowerK005 = [];
thresholdK005 = [];
noisePowerK01 = [];
thresholdK01 = [];
noisePowerK05 = [];
thresholdK05 = [];





%% Noise charactization plots: Second Order PLL
Bl = [10 20 30 40 50 60];
cn0 = [35 40 45 50 60];
noisePowerBl10 = [1090.278549 271.844448 80.020182 24.870782 2.447463];
thresholdBl10 = [1000 1100 1100 1500 2000];
noisePowerBl20 = [1134.436031 264.879452 79.240616 25.433156 2.426378];
thresholdBl20 = [1000 1000 1000 1200 1200];
noisePowerBl30 = [1236.048311 281.420084 81.877807 24.411705 2.502479];
thresholdBl30 = [1000 1000 1000 900 800];
noisePowerBl40 = [1234.120404 271.186310 81.766125 25.189881 2.527062];
thresholdBl40 = [800 800 800 700 600];
noisePowerBl50 = [1243.855370 286.371578 81.335278 26.410251 2.656466];
thresholdBl50 = [800 800 600 600 500];
noisePowerBl60 = [1237.519903 281.098273 87.126546 26.700544 2.683888];
thresholdBl60 = [500 500 500 500 500];

noisePowerdB = 10*log10([noisePowerBl10' noisePowerBl20' noisePowerBl30' noisePowerBl40' noisePowerBl50' noisePowerBl60']);
noiseThreshold = [thresholdBl10' thresholdBl20' thresholdBl30' thresholdBl40' thresholdBl50' thresholdBl60'];

[BL,CN0] = meshgrid(Bl,cn0);

figure; plot(cn0, 10*log10(noisePowerBl10), ...
cn0, 10*log10(noisePowerBl20), ...
cn0, 10*log10(noisePowerBl30), ...
cn0, 10*log10(noisePowerBl40), ...
cn0, 10*log10(noisePowerBl50), ...
cn0, 10*log10(noisePowerBl60));
xlabel('CN0'); ylabel('Noise Power (dB)');
legend('BW = 10 Hz', 'BW = 20 Hz', 'BW = 30 Hz', 'BW = 40 Hz', 'BW = 50 Hz', 'BW = 60 Hz')
title('Comparison of noise PSD at discriminator output');

figure; plot(Bl, noisePowerdB(1,:), ...
Bl, noisePowerdB(2,:), ...
Bl, noisePowerdB(3,:), ...
Bl, noisePowerdB(4,:), ...
Bl, noisePowerdB(5,:));
xlabel('BW (Hz)'); ylabel('Noise Power (dB)');
legend('CN0 = 35', 'CN0 = 40', 'CN0 = 45', 'CN0 = 50', 'CN0 = 60')
title('Comparison of noise PSD at discriminator output');

figure; plot(cn0, thresholdBl10, ...
cn0, thresholdBl20, ...
cn0, thresholdBl30, ...
cn0, thresholdBl40, ...
cn0, thresholdBl50, ...
cn0, thresholdBl60);
xlabel('CN0'); ylabel('Convergence time (sec)');
legend('BW = 10 Hz', 'BW = 20 Hz', 'BW = 30 Hz', 'BW = 40 Hz', 'BW = 50 Hz', 'BW = 60 Hz')
title('Convergence time comparison');

figure;
[~,ph] = contourf(BL, CN0, noisePowerdB);
set(ph,'LineColor','none')
grid off;
xlabel('Bandwidth (Hz)'); ylabel('CN0');
k = colorbar;
set(get(k,'label'),'string', 'Noise Power (dB)');
title('Noise Power at Discriminator Output');

0 comments on commit 44f9bc9

Please sign in to comment.