资源简介
MPSK的符号同步算法,MATLAB编写,可运行
代码片段和文件信息
clear
clc
close all
% ********************** 加载波和位定时同步 ***************************************************
fs = 88; % 整个系统的采样频率
dt = 1/fs;
f_i = 22;
pi2 = 2*pi;
% c1 = 1/256;
% c2 = 1/(2048+128);
% c3 = 1/(2048+128);
c1 = 1/128;
c2 = 1/(2048+128);
c3 = 1/2048; % 针对-0.02情况。
barkercode_11 = [1 1 1 -1 -1 -1 1 -1 -1 1 -1];
pn_15 = [1 1 1 1 0 1 0 1 1 0 0 1 0 0 0];
pn_sequence = pn_15*2-1;
coeff_5 = firrcos(285.50.2588‘rolloff‘‘sqrt‘);
% coeff_44 =[4 1 -4 -4 2 12 14 -2 -30 -48 -24 48 152 248 284 248 152 48 -24 -48 -30 -2 14 12 2 -4 -4 1 4];
Match_barker = kron(barkercode_11ones(12));
c_1 = inline(‘1/6*u^3-1/6*u‘);
c_2 = inline(‘-1/2*u^3+1/2*u^2+u‘);
c_3 = inline(‘1/2*u^3-u^2-1/2*u+1‘);
c_4 = inline(‘-1/6*u^3+1/2*u^2-1/3*u‘);
fid = fopen(‘rand_data.m‘‘r‘);
source1 = fread(fid)‘;
fclose(fid);
source = [source1 zeros(1100)];
sig_i = [1 pn_15 source(1:2:end)];
sig_q = [1 pn_15 source(2:2:end)];
match_regist = zeros(2size(Match_barker2));
% match_regist1 = zeros(2size(Match_barker2));
num = [0.01 1];
den = [1 1.01 1];
[AfBfCfDf] = tf2ss(numden);
for i = 1:length(sig_i)
if i == 1
DQpsk(1i) = 1;
DQpsk(2i) = 1;
else
DQpsk(1i) = abs(xor(sig_i(i)sig_q(i))-1)*xor(sig_i(i)pre_i) + xor(sig_i(i)sig_q(i))*xor(sig_q(i)pre_q);
DQpsk(2i) = abs(xor(sig_i(i)sig_q(i))-1)*xor(sig_q(i)pre_q) + xor(sig_i(i)sig_q(i))*xor(sig_i(i)pre_i);
end
pre_i = DQpsk(1i);
pre_q = DQpsk(2i);
end
DQpsk = DQpsk*2-1;
Expand_sig = kron(DQpskbarkercode_11); % spread
Ep_insert_sig = zeros(2length(Expand_sig)*8); % insert 8 zero
Ep_insert_sig(:1:8:end) = Expand_sig;
Filter_sig(1:) = conv(Ep_insert_sig(1:)coeff_5); % low_filter (fc = 11fs =88);
Filter_sig(2:) = conv(Ep_insert_sig(2:)coeff_5);
t = [0:dt:(size(Filter_sig2)-1)*dt];
Md_sig_c = Filter_sig(1:).*cos(pi2*22*t);
Md_sig_s = Filter_sig(2:).*sin(pi2*22*t);
clear Ep_insert_sig;
clear Filter_sig;
clear Ep_insert_sig;
sig_stor_c = resample(Md_sig_c87988800);
sig_stor_s = resample(Md_sig_s87988800);
dt1 = 1/87.98;
t = [0:dt1:(length(sig_stor_s)-1)*dt1];
noice = randn(1length(sig_stor_c));
step = 2;
snr_min = 4;
snr_max = 4;
err_rate = [];
store = [];
sig_ave_pow = (norm(sig_stor_c)^2+norm(sig_stor_s)^2)/length(sig_stor_c);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 接受端 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for snr = snr_min:step:snr_max
snr
Md_sig = sig_stor_c + sig_stor_s; % I
Md_sig = Md_sig/sqrt(sig_ave_pow) +sqrt(10^(-snr/10))*noice*sqrt(0.5);
%--------------高频部分略过通过下载波可以得到 Md_sig_c 和 Md_sig_s --------------------
nco_out = 0;
nco_nature = 22.01;
i = 0;
dc_rig = zeros(129);
ds_rig = zeros(129);
match_out = zeros(222);
phase_err = 0;
fx = zeros(22);
%-----------------Timing_parament--------------------------------------------
it_f
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 14055 2013-08-13 19:35 Gardner_for _DQPSK\gardner1.m
文件 2405 2013-08-13 19:24 Gardner_for _DQPSK\gardner_BPSK.m
文件 44592 2006-04-16 10:03 Gardner_for _DQPSK\imag_timing.fig
文件 10330 2005-03-24 23:34 Gardner_for _DQPSK\none_timing_resample.m
文件 8000 2005-03-25 09:10 Gardner_for _DQPSK\rand_data.m
文件 122 2005-03-25 09:10 Gardner_for _DQPSK\rand_source.m
文件 14218 2005-03-25 12:03 Gardner_for _DQPSK\timing_resample.m
文件 2676 2005-03-24 23:38 Gardner_for _DQPSK\timng_test.m
文件 6033 2005-03-25 09:38 Gardner_for _DQPSK\tming_test1.m
目录 0 2013-08-13 19:27 Gardner_for _DQPSK
----------- --------- ---------- ----- ----
102431 10
- 上一篇:肤色检测matlab代码
- 下一篇:图像的饱和度,亮度,色调的matlab代码
评论
共有 条评论