原理参照的是《通信中的同步技术及应用》一书的119页的框图
但是环路始终无法锁定,希望高人指点,坐等答复……
程序如下:
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % QPSK 载波恢复环
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
close all;
clear all;
%**** Initialize the Varibales ******
fs=1e8; %采样频率:100MHz
ts=1/fs;
fc=5e6; %载频:5MHz
fd=5e5; %码速率:500KHz
T=0.0001; %分析时间长度
num = 1e4;
SNR = 100;
N_S= randi([0 1],1,2000); %基带二进制序列
psk4= strPSK4_modu(N_S,fs,fc,fd,T); %产生QPSK信号
qpskdata= psk4(1:num);
data = awgn(qpskdata,SNR);
local_fc = 5000200; % local signa delta_fc:[-200 200]
n = fs/fc;
m = [0:n-1];
nf = floor(num/n);% divide input into nf 1ms block signal
temp = 0;
frame = 0;
phase = 0;
Q_sum=0;
I_sum=0;
Q_T=[];
I_T=[];
% ***** Compute the PLL coefficients for the PLL_IN phase ******
[c1,c2] = calculatePLLCoef(0.707,30); %噪声带宽增大,跟踪精度降低,而跟踪时间减小
for frame=1:nf
% ***** Generate local sine and consine replica *****************
expcol = exp(1i*(2*pi*local_fc*ts*m));
sine = imag(expcol);
cosine = real(expcol);
% ***** Take 1ms of data from the input data *********************
x = data((1:n)+((frame-1)*n));
% **** Convent the signal down to baseband ***********************
x_sine = x.*sine;
x_cosine = x.*cosine;
% **** Realize integral operation to code period(200) *****************
if(length(Q_T)==200)
Q_sum=sum(Q_T);
Q_T=[];
else
Q_T=[Q_T x_sine];
end
if(length(I_T)==200)
I_sum=sum(I_T);
I_T=[];
else
I_T=[I_T x_cosine];
end
% **** Code and Phase discriminators *************************
phase_discri(frame) = sign(Q_sum)*I_sum-sign(I_sum)*Q_sum;
% ******* Phase lock loop (PLL) ************
temp = temp+c2*phase_discri(frame); % integral branch
dfrq = c1*phase_discri(frame)+temp; % loop filter
local_fc = local_fc-dfrq/(2*pi*ts); % change local frequency(must be -)
% phase = 2*pi*local_fc*ts+phase; % make the phase of each block
dfrq_frame(frame) = local_fc; % save the changes of local frequency
end
plot(dfrq_frame);
hold on
plot([1:length(dfrq_frame)],fc,'r.');
legend('PLL tracking frequency','Real input frequency');
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |