代码对补零信号与未补零信号都进行了实现,补零信号更加贴近书中图3.4的样子:
clc
clear all
close all%参数设置
TBP = 100; %时间带宽积
T = 10e-6; %脉冲持续时间
alpha_os = [1.4,1.2,1.0,0.8]; %过采样率%补零信号与不补零信号
G = figure;
H = figure;for i=1:4%参数计算B = TBP/T; %信号带宽K = B/T; %线性调频频率F = alpha_os(i)*B; %采样率N = 2*ceil(F*T/2); %采样点数dt = T/N; %采样时间间隔df = F/N; %采样频率间隔%变量设置t = -T/2:dt:T/2-dt; %时间变量f = -F/2:df:F/2-df; %频率变量f_zero = -F/2:F/(2*N):F/2-F/(2*N); %补零后的频率变量%信号表达st = exp(1j*pi*K*t.^2); %chirp信号复数表达式Sf1 = fft(fftshift(st)); %chirp信号频谱表达式st_zero = [st,zeros(1,N)]; %chirp信号补零表达式Sf2 = fft(fftshift(st_zero)); %chirp信号补零频谱表达式%不补零信号绘图figure(G)subplot(4,2,2*i-1),plot(t*1e+6,real(st))axis([-5 5,-1.2 1.2])subplot(4,2,2*i),plot(f*1e-6,abs(Sf1))axis([-4 4,0 22])%补零信号绘图figure(H)subplot(4,2,2*i-1),plot(t*1e+6,real(st))axis([-5 5,-1.2 1.2])subplot(4,2,2*i),plot(f_zero*1e-6,abs(Sf2))axis([-4 4,0 22])end