%CW
%参考:声呐技术 P27,31
clc;close all;clear all;
%参数-------------------------
f0=50;
T=0.1;%时宽
B=1/T;
fs=1000;%采样频率
Ts=1/fs;%采样时间
N=T/Ts;%采样点个数
t=linspace(0,T,N);
y=exp(1i*2*pi*f0*t);
%画图--------------------------------------------------------
figure(1);
subplot(2,1,1);plot(t,real(y));title('CW脉冲信号时域波形');xlabel('时间/s');ylabel('幅度');
f=linspace(0,100,N);
Y=T*(sin(pi*(f-f0)*T))./(pi*(f-f0)*T);
subplot(2,1,2);plot(f,Y);title('CW脉冲信号频谱');xlabel('频率/Hz');ylabel('幅度');
%---------------------------------
t=-T:0.01:T;
v=-B:0.1:B;
[t,v]=meshgrid(t,v);
r=pi*v.*(T-abs(t));
X=sin(r)./r.*(T-abs(t));
%---------------------------------------
figure(2);
surf(t,v,abs(X));%模糊图
t=linspace(0,T,N);
%---------------------------------------
figure(3);
v=15;
c=1500;
v0=f0*2*v/c;
s=exp(1i*2*pi*f0*t).*exp(1i*2*pi*v0*t);
subplot(2,1,1);plot(t,real(s));title('频移的CW脉冲信号时域波形');xlabel('时间/s');ylabel('幅度');
Y=T*(sin(pi*(f-f0-v0)*T))./(pi*(f-f0-v0)*T);
f=linspace(0,100,N);
subplot(2,1,2);plot(Y);title('频移的CW脉冲信号频谱');xlabel('频率/Hz');ylabel('幅度');
%----------------------------------------------------------------------------------
t=-T:0.01:T;
v=5;
v0=f0*2*v/c; %多普勒频移v0 %时延分辨力:rou=0.6T,频移分辨力rou:0.88/T;
r=pi*v0.*(T-abs(t));
X=sin(r)./r.*(T-abs(t)); %模糊函数
figure(4);
hold on;
plot(t,abs(X),'red');
t=-T:0.01:T;
v=7;
v0=f0*2*v/c;
r=pi*v0.*(T-abs(t));
X=sin(r)./r.*(T-abs(t));
plot(t,abs(X));
hold off;