威望0
积分7946
贡献0
在线时间763 小时
UID1
注册时间2021-4-14
最后登录2024-11-21
管理员
- UID
- 1
- 威望
- 0
- 积分
- 7946
- 贡献
- 0
- 注册时间
- 2021-4-14
- 最后登录
- 2024-11-21
- 在线时间
- 763 小时
|
[mw_shl_code=applescript,true]function[y] = matched_filter(nscat,taup,b,rrec,scat_range,scat_rcs,winid)
eps = 1.0e-16;
time_B_product=b*taup;
if(time_B_product<5)
fprintf('*******Time Bandwidth product is TOO SMALL*******')
fprintf('\n Change b and or taup')
return
end
%
%speed of light
c= 3.e8;
%nunber of samples
n = fix(5*taup*b);
%intialize input ,output ,and replica vectors
x(nscat,1:n)= 0.;
y(1:n) = 0.;
replica(1:n) = 0.;
if winid == 0
win(1:n)= 1.;
end
if winid == 1
win = hamming(n);
end
if winid == 2
win = kaiser(n,pi);
end
if winid == 3
win = chabwin(n,60);
end
index = find(scat_range>rrec);
if index~=0
'Error .Recive window is too large;or scatterers fall outside window'
return
end
%
%calculate sampling interval
t= linspace(-taup/2,taup/2,n);
replica = exp(1i*pi*(b/taup).*t.^2);
figure(1)
subplot(2,1,1)
plot(t,real((replica)))
ylabel('复制品的真实(部分)')
xlabel('时间(秒)')
grid
subplot(2,1,2)
sampling_interval = taup/n;
freqlimit = 0.5/sampling_interval;
freq = linspace(-freqlimit ,freqlimit,n);
plot(freq,fftshift(abs(fft(replica))));
ylabel('复制品光谱');
xlabel('以HZ为单位的频率')
grid
for j = 1:1:nscat
range = scat_range(j);
x(j, = scat_rcs(j).*exp(1i*pi*(b/taup).*(t+(2*range/c)).^2);
y = x(j,+y;
end
%
figure(2)
y=y.*win;
plot(t,real(y),'k')
xlabel('以秒为单位的相对延迟')
ylabel('未压缩 回波')
grid
out=xcorr(replica,y);
out = out./n;
s= taup*c/2;
Npoints = ceil(rrec*n/s);
dist=linspace(0,rrec,Npoints);
delr = c/2/b;
figure(3)
plot(dist,abs(out(n:n+Npoints-1)),'k')
xlabel('以米为单位的目标相对位置')
ylabel('压缩回波')
grid
return
[/mw_shl_code] |
|