📄 interp_syncf.m
字号:
function y = InterP_syncF(r,Slot_length,h,N,sync_pos)
% if sync_pos<0
% x=[zeros(1,-floor(sync_pos/3)) x];
% sync_pos=-floor(sync_pos/3)*3+sync_pos;
% end
%
% if sync_pos>2
% x=x(floor(sync_pos/3)+1:end);
% sync_pos=sync_pos-floor(sync_pos/3)*3;
% end
K1=floor(sync_pos/3);
K2=sync_pos-3*K1; % Filter_length=2*K1*Carrier_number+K2;
x=r(K1+1:end);
% sync_pos is now in [0,3)
switch K2
case 0,
% x=[x,zeros(1,20)];
y=x(5+(1:2:2*Slot_length));
case 1,
% x=[zeros(1,5),x,zeros(1,20)];
h1=h(3:3:end);
for n=1:Slot_length
y(n)=x(2*n-1:2*n+10)*h1';
end
case 2,
% Lx=length(x); Lh=length(h);Lz=(Lx-1)*N+Lh;
% z=zeros(1,Lz);
% l=1;
% for n=1:Lx
% z(l:l+Lh-1)=z(l:l+Lh-1)+x(n)*h;
% l=l+N;
% end
%
% yy=z((Lh+1)/2+sync_pos:6:Lz-(Lh-1)/2);
% x=[zeros(1,5),x,zeros(1,20)];
h2=h(2:3:end);
for n=1:Slot_length
y(n)=x(2*n-1:2*n+10)*h2';
end
% plot(real(y(1:50)))
% hold on
% plot(real(yy(1:50)),'r')
% hold off
% y(1:50)-yy(1:50)
% pause
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -