📄 lfm_test.m
字号:
N=1200;
tao=2e-4;
f1=0;
B=1*10^6;
u=B/tao;
N_total=B*tao;
N_left=N/2-N_total/2;
N_right=N/2+N_total/2;
N_left2=N/2-N_total/2*1.8;
N_right2=N/2+N_total/2*1.8;
t=(-tao/2:tao/(N-1):tao/2);
ff=[-B/2:B/(N_right-N_left):B/2];
ff2=[-B/2:B/(N_right2-N_left2):B/2];
fw=0.08+0.92*cos(pi*ff/B).^2;
fw2=0.08+0.92*cos(pi*ff2/B).^2;
s=exp(j*2*pi*(f1*t+0.5*u*t.^2));
Y=(fftshift(fft(s)));
ll=length(Y);
f=(1/tao)*(-(ll-1)/2:(ll-1)/2);
Y1=Y(N_left:N_right);
YW=Y1.*fw;
YW=[Y(1:N_left-1),YW,Y(N_right+1:N)];
Y2=Y(N_left2:N_right2);
YW2=Y2.*fw2;
YW2=[Y(1:N_left2-1),YW2,Y(N_right2+1:N)];
h1=fftshift(abs(ifft(Y.*conj(Y))));
h=h1/max(h1);
hw=abs(fftshift(ifft(YW.*conj(YW))));
hw2=abs(fftshift(ifft(YW2.*conj(YW2))));
tt=-(length(h)-1)/2:(length(h)-1)/2;
subplot(2,3,1)
plot(f,abs(Y)/max(abs(Y)));
axis([-B B 0 1])
grid on
subplot(2,3,4)
plot(t,20*log10(h/max(h)))
axis([-tao/8 tao/8 -80 0])
grid on
subplot(2,3,2)
plot(f,abs(YW)/max(abs(YW)))
axis([-B B 0 1]);
grid on
subplot(2,3,5)
plot(t,20*log10(hw/max(hw)))
grid on
axis([-tao/8 tao/8 -80 0])
subplot(2,3,3)
plot(f,abs(YW2)/max(abs(YW2)))
grid on
axis([-B B 0 1])
subplot(2,3,6)
plot(t,20*log10(hw2/max(hw2)))
axis([-tao/8 tao/8 -80 0])
grid on
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -