资源简介
gardner位同步的仿真代码,实现了QPSK在存在采样频率误差的情况下恢复星座图
代码片段和文件信息
%File:timing_syn.m timing synchronization
clc
clear
Data_Len = 8030;
Fs = 10000; % Sampling Frequency
Fd = 2500; % Symbol Frequency
SNR_max = 12; % S/N Ratio for Chanel Simulatioin
SNR_min = 4;
RolloffCoef = 0.35; % Roll Off Coeff.
T_Gain = 0.09; % TED Loop Gain
Ratio = Fs/Fd/2; % = Ts/Td/2
Offset = 23; %
mm = 1;
%for snr=SNR_min:1:SNR_max
%for RolloffCoef_a=0.1:0.05:0.4
x= zeros(1Data_Len/2); %产生的符号数
timing_error = 0;
datalen = Fs / Fd * (Data_Len - Offset);
displaysize = 128;
ted_out = zeros(1displaysize);
%Interp_Pos = 2*Ratio + Ratio;
Interp_Pos = Ratio;
Rec_out = zeros(1displaysize);
h = [0.04 -0.36 0.60 -0.36 0.04];
disp(‘1 Data Send‘);
%1+++++++++++++Data Source+++++++++++++++++++
disp(‘ 1.1 Data Source‘);
%x = (-1).^(rand(1Data_Len)>0.5) + j * (-1).^(rand(1Data_Len)>0.5);
source = randint(1Data_Len);
sig_i = [1 source(1:2:end)];
sig_q = [1 source(2:2:end)];
DQpsk = zeros(2length(sig_i));
for i = 1:length(sig_i)
if i == 1
DQpsk(1i) = 1;
DQpsk(2i) = 1;
else
DQpsk(1i) = abs(xor(pre_ipre_q)-1)*xor(sig_i(i)pre_i) + xor(pre_ipre_q)*xor(sig_q(i)pre_i);
DQpsk(2i) = abs(xor(pre_ipre_q)-1)*xor(sig_q(i)pre_q) + xor(pre_ipre_q)*xor(sig_i(i)pre_q);
end
pre_i = DQpsk(1i);
pre_q = DQpsk(2i);
x(i)=(DQpsk(1i)*2-1)+j*(DQpsk(2i)*2-1);
end
DQpsk = DQpsk*2-1;
%tx_signal=rcosflt(xFdFs‘fir‘0.2510);
% figure(1)
% plot(x‘k*‘);
% xlabel(‘real‘)
% ylabel(‘image‘)
% xlim([-2.0 2.0]);
% ylim([-2.0 2.0]);
% title(‘Sending Conset‘)
% grid on;
%+++++++++++++pulse shaping+++++++++++++++++++
% Using Rolloff Setting
%+++++++++++++++++++++++++++++++++++++++++++++
disp(‘ 1.2 Pulse Shaping‘);
x_t=rcosflt(xFdFs‘sqrt‘RolloffCoef);
% figure(7);
% x_kk=fft(x_t);
% plot(abs(x_kk)‘-‘‘MarkerSize‘14);
%+++++++++++++channel simulation++++++++++++++
% Add White Offsetoise Using SOffsetR Setting
%+++++++++++++++++++++++++++++++++++++++++++++
disp(‘2 Channel Simulation‘);
c_t = awgn(x_t15‘measured‘);
%++++++++++++++++++receive++++++++++++++++++++
disp(‘3 Receive‘);
%4++++++++++Matching Filter++++++++++++++++++++
disp(‘ 3.1 Matching Filter‘);
%matched_data=rcosflt(r_tFdFs‘sqrt/Fs‘RolloffCoef);
r_c_t=resample(c_t1001710000);
r_t=rcosflt(r_c_tFdFs‘sqrt/Fs‘RolloffCoef);
matched_data=[r_t(Offset+1:end-Offset)];
%++++++++++++Timing Recovery+++++++++++++++++++
% =======Gardner Timing Recovery===============
% TE(k)={Y[(k-1)Td]-Y[kTd])*Y[(kTd-Td/2]
% =======Parabolic Interpolation===============
% C_2 = 0.5 * mu^2 - 0.5 * mu;
% C_1 = -0.5 * mu^2 + ( 0.5 + 1 ) * mu;
% C0 = -0.5 * mu^2 + ( 0.5 - 1 ) * mu + 1;
% C1 = 0.5 * mu^2 - 0.5 * mu;
%+++++++++++++++++++++++++++++++++++++++++++++++
disp(‘ 3.2 Timing Recovery‘);
C_2 = inline(‘0.
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 8190 2012-07-27 10:51 timing_syn_Gardner.m
----------- --------- ---------- ----- ----
8190 1
- 上一篇:多轴传动控制系统原理图
- 下一篇:对射式光电传感器原理图及程序
相关资源
- 数字时钟,采用555构成的多协振荡器
- 电子时钟的设计显示时,分,秒
- 数字时钟基于Multisim
- ds1302时钟、温度、LCD1602显示,按键设
- AT89C51数字时钟
- PSoC单片机读秒带LED灯全零闪烁功能时
- 数字电子技术基础课程设计 —数字时
- 电子时钟的设计与制作
- 51单片机1602与DS1302万年历仿真,时钟
- 操作系统-时钟中断-模拟时钟中断的产
- 时钟.c
- MSP430时钟程序
- 可控制的时钟.exe
- 单片机电子时钟的设计
- 汇编 简易时钟倒计时
- STM32F407学习板 开发板 全部例程原理图
- 用7段共阳数码管做的时钟 verilog程序
- 0011、采用实时时钟芯片DS1302+AT89C205
- 数码管时钟 电子钟 时分秒 可调时分
- PIC单片机之DS1302时钟
- DSP的VCM低频主动隔振控制系统设计
- 全功能SPI接口的设计与实现
- AD9520 Verilog
- 抖音八卦时钟
- win10自制桌面时钟代码
- UWB定位STM32 TDOA无线时钟同步源代码
- 用proteus制作数字时钟
- 51单片机ALE引脚的使用
- 基于AT89C51和LCD1602的电子时钟
- 基于STM32 的实时时钟并显示在0.96OLE
评论
共有 条评论