How do you set normalized loop bandwidth in Carrier Synchronizer algorithm?
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have implemented my own carrier synchronizer function based off of the algorithm from this Matlab page:
My code works, however, the Loop Bandwidth (Bn*T) that is prescribed in the documentation does not work for me. Instead I am using Bn * T = 0.005. I came across this value purely by chance, and I am not sure why it is that...
Matlab's default value is Bn = 0.01.
I assumed T = 1 / symbol rate, since this is not explained on the page. The symbol rate in my simulation is 36e6 Sym/s, so I assume T = 2.7778e-8.
Using these assumptions, Bn * T = 2.777e-10, which is orders of magnitudes away from my working value of 0.005.
So my question is, what is T?
If I reverse the equation from my working Bn * T = 0.005, with Bn = 0.01, then T = 0.5, but what does T = 0.5 mean?
Here is my code, with Bn and T set to my working values:
close all
rng(41)
sample_rate = 36e6;
nSym = 15000;
nBit = nSym*2;
nMap = nBit / nSym;
%% Create bits and modulate them to QPSK
bits = randi([0 1], nSym, nMap);
sym0 = 2^-0.5 + 1j*2^-0.5;
sym1 = -2^-0.5 + 1j*2^-0.5;
sym2 = 2^-0.5 - 1j*2^-0.5;
sym3 = -2^-0.5 - 1j*2^-0.5;
syms = zeros(nSym, 1);
for loop = 1:nSym
if bits(loop,:) == [0,0]
syms(loop, 1) = sym0;
elseif bits(loop,:) == [0, 1]
syms(loop, 1) = sym1;
elseif bits(loop,:) == [1, 0]
syms(loop, 1) = sym2;
elseif bits(loop,:) == [1, 1]
syms(loop, 1) = sym3;
end
end
%% Add Noise
xn = awgn(syms, 20);
scatterplot(xn)
title('Sybmbols with Noise')
%% Freq and Phase Offset
pfo = comm.PhaseFrequencyOffset('PhaseOffset',45,'FrequencyOffset',1e5, ...
'SampleRate',sample_rate);
xn = pfo(xn);
scatterplot(xn)
title('Sybmbols with Noise and Phase and Frequency Offset')
%% Create Arrays
yn = zeros(nSym, 1);
yn_rot = zeros(nSym, 1);
en = zeros(nSym, 1);
psin = zeros(nSym, 1);
lambdan = zeros(nSym, 1);
demod_s = zeros(nSym, 2);
lambda = 0;
%% Algorithm Values
T = 0.5; % WHAT DOES THIS MEAN?
Bn = 0.01; % WHAT DOES THIS MEAN?
zeta = 0.707; % damping factor
K0 = 1;
Kp = 2;
omega = (Bn * T) / (zeta + (1 / (4*zeta)));
d = 1 + (2 * zeta * omega) + omega^2;
gi = (4 * (omega^2) / d) / (Kp * K0);
gp = (4 * zeta * omega / d) / (Kp * K0);
%% Loop over the incoming symbols
for loop = 1:nSym
%% Phase Shift
yn(loop, 1) = xn(loop) * exp( 1i * lambda );
y = yn(loop, 1);
%% Rotate the output to correct positions
% This needs to be replaced by another function that rotates
% automatically based on Start Of Frame or Pilots
% This value works with current SNR and RNG seed
yn_rot(loop, 1) = y * exp(1i * 3*pi/4) * -1;
y_rot = yn_rot(loop, 1);
%% Phase Error Detector
en(loop,1) = sign(real(yn(loop,1))) * imag(yn(loop,1))...
- sign(imag(yn(loop,1))) * real(yn(loop,1));
e = en(loop, 1);
%% Loop Filter Starting Values
% psi_1 is previous psi
% en_1 is previous em
if loop == 1
psi_1 = 0;
en_1 = 0;
lambdan_1 = 0;
else
psi_1 = psin(loop-1, 1);
en_1 = en(loop-1, 1);
lambdan_1 = lambdan(loop-1, 1);
end
psin(loop, 1) = gi * en(loop,1) + psi_1;
psi = psin(loop, 1);
%% DDS
lambdan(loop, 1) = (gp * en_1 + psi_1) + lambdan_1;
lambda = lambdan(loop, 1);
%% Hard Demodulate
if real(y_rot) > 0 && imag(y_rot) > 0
demod_s(loop,:) = [0, 0];
elseif real(y_rot) < 0 && imag(y_rot) > 0
demod_s(loop,:) = [0, 1];
elseif real(y_rot) > 0 && imag(y_rot) < 0
demod_s(loop,:) = [1, 0];
elseif real(y_rot) < 0 && imag(y_rot) < 0
demod_s(loop,:) = [1, 1];
end
end
%% Results
figure()
subplot(3, 1, 1)
plot(en)
title('Phase Error Detector')
subplot(3, 1, 2)
plot(psin)
title('Loop Filter Output')
subplot(3, 1, 3)
plot(lambdan)
title('DDS Output')
xlabel('Time (Symbols)')
[~, ber] = biterr(bits(end-1000:end,:), demod_s(end-1000:end,:))
scatterplot(yn_rot(end-10000:end, :))
title('Carrier Synchronized Output')
0 commentaires
Réponses (1)
Sachin Lodhi
le 28 Déc 2023
Hello Matthew,
Your assumption of 'T = 1 / symbol rate' is correct. The normalized loop bandwidth parameter in the context of a phase-locked loop (PLL) used for carrier synchronization is a dimensionless quantity that represents the bandwidth of the loop filter relative to the rate at which symbols are received (symbol rate).
To calculate the normalized loop bandwidth, you can use the following formula:
Normalized Loop Bandwidth = Bn * T
where:
'Bn' is the desired loop bandwidth in Hertz (Hz).
T = 1 / fs where 'fs' is the symbol rate in symbols per second (symbols/second).
So, if you have the value of 'T = 0.5', it suggests that the symbol period is 0.5 seconds (meaning that the symbol rate fs is 2 symbols per second, since ( fs = 1 / T)).
Hope this helps.
Best Regards,
Sachin
0 commentaires
Voir également
Catégories
En savoir plus sur Assumptions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!