📄 pr8_15.m
字号:
%Problem 8.15;
%discriminator curves;
clear all; close all;
t=[0:99]/100; DEL=length(t); %chip duration;
ChOptions=[ones(1,DEL);cos(pi*(t-0.5));exp(-16*(t-0.5).^2)]; %optional chip shapes;
Ch=ChOptions(1,:); %selection of chip shape;
delta=[DEL/2,DEL,2*DEL]; Ld=length(delta); Md=max(delta); %early-late separations (should be integer);
ACF=xcorr(Ch)/(Ch*Ch'); %chip ACF;
for k=1:Ld
earl=[zeros(1,2*DEL-floor(delta(k)/2)),ACF,zeros(1,2*DEL+floor(delta(k)/2))]; %early ACF;
late=circshift(earl,[0,delta(k)]); %late ACF;
CohDC=earl-late; L=length(CohDC); %coherent discriminator curve;
timerror=([0:L-1]-L/2)/100; %time error for plotting;
tx=num2str(delta(k)/DEL); tx=['\delta/\Delta= ',tx]; %prepares text mark;
subplot(Ld,2,2*k-1); plot(timerror,earl+0.02,'k',timerror,-late-0.02,'b',timerror,CohDC,'r','linewidth',2); text(1.2,0.8,tx);
xlabel('\epsilon/\Delta'); grid; ylim([-1.2,1.2]); xlim([-L,L]/200); ylabel('e(\epsilon)'); %plotting coherent discriminator curve;
if k==1 title('coherent discriminator'); end;
IncDC=earl.^2-late.^2; %non-coherent discriminator curve;
subplot(Ld,2,2*k); plot(timerror,earl.^2+0.02,'k',timerror,-late.^2-0.02,'b',timerror,IncDC,'r','linewidth',2); text(1.2,0.8,tx);
if k==1 title('non-coherent discriminator'); end;
grid; ylim([-1.2,1.2]); xlim([-L,L]/200); xlabel('\epsilon/\Delta'); ylabel('e(\epsilon)'); %plotting non-coherent discriminator curve;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -