用Python实现《合成孔径雷达成像——算法与实现》中的仿真图3.1。
import matplotlib.pyplot as plt
import numpy as np
import math
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus']=False #用来正常显示负号
#信号持续时间T=7.24us,信号带宽B=5.8MHz,将过采样率设为5是为了更清晰地观测信号波形
T = 7.24e-6 # 信号持续时间
B = 5.8e6 # 信号带宽
K = B/T # 调频率
ratio = 5 # 过采样率
Fs = ratio*B # 采样频率
dt = 1/Fs # 采样间隔
N = math.ceil(T/dt) # 采样点数
t = np.arange((0-N/2)/N*T,(N-N/2)/N*T,dt) # 时间轴
st = np.exp(1j*math.pi*K*np.multiply(t, t)) #生成信号
## 画图
plt.figure(1)
plt.subplot(2,2,1)
plt.title('(a)信号的实部')
plt.plot(t*1e6,np.real(st))
plt.xlabel('相对于$\mathregular{t_0}$''时间(μs)')
plt.ylabel('幅度')
plt.subplot(2,2,2)
plt.title('(c)信号相位')
plt.plot(t*1e6,math.pi*K*np.multiply(t, t))
plt.xlabel('相对于$\mathregular{t_0}$''时间(μs)')
plt.ylabel('弧度')
plt.subplot(2,2,3)
plt.title('(b)信号的虚部')
plt.plot(t*1e6,np.imag(st))
plt.xlabel('相对于$\mathregular{t_0}$''时间(μs)')
plt.ylabel('幅度')
plt.subplot(2,2,4)
plt.title('(d)信号频率')
plt.plot(t*1e6,K*t*1e-6)
plt.xlabel('相对于$\mathregular{t_0}$''时间(μs)')
plt.ylabel('MHz')
plt.show()