标签:
如果发射信号是线性调频信号,上一次讲的距离成像算法流程(匹配滤波方法)依然可以用,但那个流程要求
这两个过程在matlab代码中体现得很清楚了,不再展开。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%基本参数
clear clc
colormap(gray(256))
cj=sqrt(-1);
pi2=2*pi;
%
c=3e8; % Propagation speed
B0=100e6; % Baseband bandwidth is plus/minus B0
w0=pi2*B0;
fc=1e9; % Carrier frequency
wc=pi2*fc;
Xc=2.e3; % Range distance to center of target area
X0=50; % target area in range is within [Xc-X0,Xc+X0]
%
% Case 1:
Tp=.1e-6; % Chirp pulse duration
%
% % Case 2:
Tp=10e-6; % Chirp pulse duration
alpha=w0/Tp; % Chirp rate
wcm=wc-alpha*Tp; % Modified chirp carrier 即是式子中的beta
%
dx=c/(4*B0); % Range resolution
%采样间隔
dt=pi/(2*alpha*Tp); % Time domain sampling (gurad band plus minus
% 50 per) or use dt=1/(2*B0) for a general
% radar signal
% 可能是因为信号是实信号 所以是采样频率是信号带宽的2倍
Tx=(4*X0)/c; % Range swath echo time period
%压缩信号的采样间隔
dtc=pi/(2*alpha*Tx); % Time domain sampling for compressed signal
% (gurad band plus minus 50 per)
%
Ts=(2*(Xc-X0))/c; % Start time of sampling
Tf=(2*(Xc+X0))/c+Tp; % End time of sampling
% If Tx < Tp, choose compressed signal parameters for measurement
% 因为硬件倾向于信号有着较小的带宽,所以如果压缩后的信号可以满足这个,首先会选择使用这个压缩后的信号
% 可想而知,这样子回波信号(未压缩的)采样的间隔就过大了,所以需要进行升采样。
flag=0; % flag=0 indicates that Tx > Tp
if Tx < Tp,
flag=1; % flag=1 indicates that Tx < TP
dt_temp=dt; % Store dt
dt=dtc; % Choose dtc (dtc > dt) for data acquisition
%就是说用dtc去采样回波信号(它应该是用dt采样才不会混叠)
end;
% Measurement parameters
%
n=2*ceil((.5*(Tf-Ts))/dt); % Number of time samples
t=Ts+(0:n-1)*dt; % Time array for data acquisition
%注意这里用了dt 后面以自变量的形式去求的回波信号序列也就是采样了
%如果它本质上是dtc,那么就是亚采样了。
%这三个参数也是取决于dt的 如果Tx < Tp后面会重新计算 因为这些参数是属于未压缩的回波信号的
%如果Tx > Tp 这里的设置当然就是对的啦
dw=pi2/(n*dt); % Frequency domain sampling
w=wc+dw*(-n/2:n/2-1); % Frequency array (centered at carrier)
x=Xc+.5*c*dt*(-n/2:n/2-1); % range bins (array); reference signal is
% for target at x=Xc.
kx=(2*w)/c; % Spatial (range) frequency array
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ntarget=4; % number of targets
%%%%%%%%%%%%% Targets‘ parameters %%%%%%%%%%%%%%%%%%
%
% xn: range; fn: reflectivity 发射系数
%
xn(1)=0; fn(1)=1;
xn(2)=.7*X0; fn(2)=.8;
xn(3)=xn(2)+2*dx; fn(3)=1.;
xn(4)=-.5*X0; fn(4)=.8;
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% SIMULATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
s=zeros(1,n); % Initialize echoed signal array
%调节na可以对比不同情况下的匹配滤波和时间域压缩两种方法的成像结果的差异
%结果是随着na的增大 时间域压缩方法变得不好
na=0; % Number of harmonics in random phase
ar=rand(1,na); % Amplitude of harmonics
ter=2*pi*rand(1,na); % Phase of harmonics
for i=1:ntarget;
td=t-2*(Xc+xn(i))/c;
pha=wcm*td+alpha*(td.^2); % Chirp (LFM) phase
for j=1:na; % Loop for CPM harmonics 相位调制!出于ECCM的考虑 amplitude modulating an LFM chirp
pha=pha+ar(j)*cos((w(n/2+1+j)-wc)*td+ter(j));
end;
s=s+fn(i)*exp(cj*pha).*(td >= 0 & td <= Tp);%回波信号 采样后的
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 第一种成像方法 匹配滤波
% If flag=1, i.e., Tx < Tp, perform upsmapling
%
if flag == 1,
td0=t-2*(Xc+0)/c;
pha0=wcm*td0+alpha*(td0.^2); % Reference chirp phase
scb=conj(s).*exp(cj*pha0); % Baseband compressed signal
% (This is done by hardware)
scb=[scb,scb(n:-1:1)]; % Append mirror image in time to reduce wrap
% around errors in interpolation (upsampling)
%DFT前进行了一个镜像扩展
fscb=fty(scb); % F.T. of compressed signal w.r.t. time
%
dt=dt_temp; % Time sampling for echoed signal 注意这个是理论上的回波信号采样间隔 之前存下的
n_up=2*ceil((.5*(Tf-Ts))/dt); % Number of time samples for upsampling %理论上的采样个数
nz=n_up-n; % number of zeros for upsmapling is 2*nz %缺少的采样个数
fscb=(n_up/n)*[zeros(1,nz),fscb,zeros(1,nz)]; %注意镜像扩展 系数是?
%
scb=ifty(fscb);
scb=scb(1:n_up); % Remove mirror image in time
%
% Upsampled parameters
%未压缩的回波信号的一些参数
n=n_up;
t=Ts+(0:n-1)*dt; % Time array for data acquisition
dw=pi2/(n*dt); % Frequency domain sampling
w=wc+dw*(-n/2:n/2-1); % Frequency array (centered at carrier)
x=Xc+.5*c*dt*(-n/2:n/2-1); % range bins (array); reference signal is
% for target at x=Xc.
kx=(2*w)/c; % Spatial (range) frequency array
%
td0=t-2*(Xc+0)/c;
s=conj(scb).*exp(cj*wcm*td0+cj*alpha*(td0.^2)); % Decompression
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Reference echoed signal
%
td0=t-2*(Xc+0)/c;
pha0=wcm*td0+alpha*(td0.^2); % Chirp (LFM) phase
for j=1:na; % Loop for CPM harmonics
pha0=pha0+ar(j)*cos((w(n/2+1+j)-wc)*td0+ter(j));
end;
s0=exp(cj*pha0).*(td0 >= 0 & td0 <= Tp);
%
% Baseband conversion
%
sb=s.*exp(-cj*wc*t);
sb0=s0.*exp(-cj*wc*t);
%
figure
plot(t,real(sb))
xlabel(‘Time, sec‘)
ylabel(‘Real Part‘)
title(‘Baseband Echoed Signal‘)
axis(‘square‘)
axis([Ts Tf 1.1*min(real(sb)) 1.1*max(real(sb))])
print P1.1a.ps
pause(1)
%
figure
plot(t,real(sb0))
xlabel(‘Time, sec‘)
ylabel(‘Real Part‘)
title(‘Baseband Reference Echoed Signal‘)
axis(‘square‘)
axis([Ts Tf 1.1*min(real(sb0)) 1.1*max(real(sb0))])
print P1.2a.ps
pause(1)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% RECONSTRUCTION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Fourier Transform
%
fsb=fty(sb);
fsb0=fty(sb0);
% Power equalization
%
mag=abs(fsb0);
amp_max=1/sqrt(2); % Maximum amplitude for equalization
afsb0=abs(fsb0);
P_max=max(afsb0);
I=find(afsb0 > amp_max*P_max);
nI=length(I);
fsb0(I)=((amp_max*(P_max^2)*ones(1,nI))./afsb0(I)).* ...
exp(cj*angle(fsb0(I)));
%
% Apply a window (e.g., power window) on fsb0 here
%
E=sum(mag.*abs(fsb0));
%
figure
plot((w-wc)/pi2,abs(fsb)) %注意自变量的范围 单位
xlabel(‘Frequency, Hertz‘)
ylabel(‘Magnitude‘)
title(‘Baseband Echoed Signal Spectrum‘)
axis(‘square‘)
print P1.3a.ps
pause(1)
%
figure
plot((w-wc)/pi2,abs(fsb0))
xlabel(‘Frequency, Hertz‘)
ylabel(‘Magnitude‘)
title(‘Baseband Reference Echoed Signal Spectrum‘)
axis(‘square‘)
print P1.4a.ps
pause(1)
%
% Matched Filtering
%
fsmb=fsb.*conj(fsb0);
%
figure
plot((w-wc)/pi2,abs(fsmb))
xlabel(‘Frequency, Hertz‘)
ylabel(‘Magnitude‘)
title(‘Baseband Matched Filtered Signal Spectrum‘)
axis(‘square‘)
print P1.5a.ps
pause(1)
%
% Inverse Fourier Transform
%
smb=ifty(fsmb); % Matched filtered signal (range reconstruction)
%
% Display
%
figure
plot(x,(n/E)*abs(smb)) %注意自变量的对应关系
xlabel(‘Range, meters‘)
ylabel(‘Magnitude‘)
title(‘Range Reconstruction Via Matched Filtering‘)
axis([Xc-X0 Xc+X0 0 1.1]); axis(‘square‘)
print P1.6a.ps
pause(1)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Time domain Compression 第二种成像方法
% 当Tp<Tx (case 1)总是得不到想要的形式?这种方法恢复出来的结果看起来也不对
% 这是因为 这个时候压缩信号的采样间隔太大了 需要通果不混叠的未压缩信号恢复出不混叠的压缩信号 在进行成像处理!
% 当然如果Tp>Tx (case 2) 两种方法恢复出来的结果基本是一致的。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
td0=t-2*(Xc+0)/c;
scb=conj(s).* ...
exp(cj*wcm*td0+cj*alpha*(td0.^2)); % Baseband compressed signal
%
figure
subplot(1,2,1)
plot(t,real(s))
subplot(1,2,2)
plot(t,real(scb))
xlabel(‘Time, sec‘)
ylabel(‘Real Part‘)
title(‘Time Domain Compressed Signal‘)
axis(‘square‘)
print P1.7a.ps
pause(1)
fscb=fty(scb);
X=(c*(w-wc))/(4*alpha); % Range array for time domain compression 注意这个转换关系
figure
subplot(1,2,1)
plot(w,(dt/Tp)*abs(fscb))
subplot(1,2,2)
plot(X+Xc,(dt/Tp)*abs(fscb))
xlabel(‘Range, meters‘)
ylabel(‘Magnitude‘)
title(‘Range Reconstruction Via Time Domain Compression‘)
axis([Xc-X0 Xc+X0 0 1.1]); axis(‘square‘)
%axis([Xc-X0 Xc+X0 0 1.1*max(abs(fscb))]); axis(‘square‘)
print P1.8a.ps
pause(1)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
标签:
原文地址:http://blog.csdn.net/qiupingzhao/article/details/51345319