📄 xinhaofangzhen.m
字号:
clear,clc,clf;
t=0:3.8*10^(-9):0.04*10^(-4);
samplefre=1/(3.8*10^(-9));
N=length(t);
lamde=0.03;
Pj=50;
Lj=7;
Lr=10;
Br=2*10^6;
Bj=10*10^6;
mae=1/3;
U0=sqrt(2*Pj/(mae^2+1));
Gj=13;
Ga=sinc(0.3-0.15)+sinc(0.3+0.15);
Gb=sinc(0.3-0.15)-sinc(0.3+0.15);
eta=0.7;
gmax=178;
Gaa=eta*gmax*Ga;
Gbb=eta*gmax*Gb;
R=30*10^3;
Pjc=(lamde^2*Br)/((4*pi*R)^2*10^(Lj/10)*10^(Lr/10)*Bj);
U01=-U0*sqrt(Pjc)*10^(Gj/20)*Gaa;
U02=-U0*sqrt(Pjc)*10^(Gj/20)*Gbb;
randn('seed',24587);Un=randn(1,N);
% Un=(square(2*pi*1e3*t,0.1)+1)/2;
x=Un.*cos(2*pi*1e8*t+pi/3);
figure(1);
plot(t,x);
xlabel('时间(s)');ylabel('信号大小(V)');
axis([0 4e-6 -4 3]);
title('调幅噪声信号','color','b');
s1=x.*U01;
s2=x.*U02;
figure(2);
subplot(211);plot(t,s1);
xlabel('(a)');ylabel('信号大小(V)');
title('和差支路接收信号','color','b');
axis([0 4e-6 -2e-4 2e-4]);
subplot(212);plot(t,s2);
axis([0 4e-6 -2e-5 2e-5]);
xlabel('(b)');ylabel('信号大小(V)');
local=cos(1.3*10^8*t);
ylocal=fft(local);
n=0:N-1;
figure(3);subplot(211);plot(t,local);
xlabel('(a)');ylabel('信号大小(V)');
title('本振信号及其频谱','color','b');
axis([0 4e-6 -1.2 1.2]);
subplot(212);plot(n,abs(ylocal));
xlabel('(b)');ylabel('频谱大小');
MUT1=s1.*local;
MUT2=s2.*local;
hhlen=length(MUT1);
figure(4);
subplot(211);plot(t,MUT1);
axis([0 4e-6 -2e-4 2e-4]);
xlabel('(a)');ylabel('信号大小(V)');
title('和差支路混频信号','color','b');
subplot(212);plot(t,MUT2);
axis([0 4e-6 -2e-5 2e-5]);
xlabel('(b)');ylabel('信号大小(V)');
f0=30e6;
w11=2*(f0-Br/2)/samplefre;
w12=2*(f0+Br/2)/samplefre;
deltaf=1e4;
w21=2*(f0-Br/2-deltaf)/samplefre;
w22=2*(f0+Br/2+deltaf)/samplefre;
r1=fir1(hhlen,[w11 w12],'bandpass');
r2=fir1(hhlen,[w11 w12],'bandpass');
h1=conv(r1,MUT1);
h1=h1(hhlen-(hhlen-1)/2:hhlen+(hhlen-1)/2);
h2=conv(r2,MUT2);
h2=h2(hhlen-(hhlen-1)/2:hhlen+(hhlen-1)/2);
w1=Br/samplefre;
w2=10/samplefre;
j=fir1(hhlen,w1,'low');
j1=fir1(hhlen,w2,'low');
J1=h1.*h2;
J2=h1.*h1;
J11=conv(j,J1);
J11=J11(hhlen-(hhlen-1)/2:hhlen+(hhlen-1)/2);
J21=conv(j1,J2);
J21=J21(hhlen-(hhlen-1)/2:hhlen+(hhlen-1)/2);
Phase1=J11./J21;
r3=fir1(hhlen,[w11 w12],'bandpass');
figure(5);
freqz(r3);
r4=fir1(hhlen,[w21 w22],'bandpass');
h3=conv(r3,MUT1);
h3=h3(hhlen-(hhlen-1)/2:hhlen+(hhlen-1)/2);
h4=conv(r4,MUT2);
h4=h4(hhlen-(hhlen-1)/2:hhlen+(hhlen-1)/2);
figure(6);
subplot(211);plot(t,h3);
xlabel('(a)');ylabel('信号大小(V)');
title('中放后和差支路信号','color','b');
subplot(212);plot(t,h4);
xlabel('(b)');ylabel('信号大小(V)');
J3=h3.*h4;
J4=h3.*h3;
J31=conv(j,J3);
J31=J31(hhlen-(hhlen-1)/2:hhlen+(hhlen-1)/2);
J41=conv(j1,J4);
J41=J41(hhlen-(hhlen-1)/2:hhlen+(hhlen-1)/2);
Phase2=J31./J41;
figure(7);
subplot(211);plot(t,Phase1,'k-');hold on;plot(t,Phase2,'r--');grid;
xlabel('(a)');title('第二类鉴相处理','color','k');
legend('中放一致时的鉴相','中放不一致时的鉴相')
subplot(212);plot(t,Phase1,'k-');hold on;plot(t,Phase2,'r--');grid;
xlabel('(b)');legend('中放一致时的鉴相','中放不一致时的鉴相');
axis([5e-7 10e-7 0.05 0.15]);
%axis([2e-6 2.5e-6 0 0.2]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -