📄 chirpwave23.m
字号:
%Quadratic-Phase Chirp
fc=4e9;%载波频率
Ts=10e-9;%chirp的持续时间
t=0:0.01e-9:10e-9;
B=7e9;%B=|miu|Ts是chirp的带宽
miu=B/Ts;
a=ones(length(t));
x1=cos(2*pi*fc*t+pi*miu*t.^2);
x12=cos(2*pi*fc*t-pi*miu*t.^2);
figure(1);subplot(2,1,1);plot(t,x1);title('二次方相位的chirp信号');
axis([0 10e-9 -2 2]);grid on;
xlabel('时间[S]');ylabel('幅度[V]');
%频谱幅度
%tf=10e-9;
%N=10e9;
%dt=tf/N;%t=[1:N]*dt;
%wf=2e9;
%Nf=1024;
%w1=linspace(0,wf,Nf);dw=wf/(Nf-1);
%F1=x1*(exp(-j*t'*w1))*dt;
someg1=fft(x1);
y1=(sqrt(((real(someg1).^2+imag(someg1).^2))/2));
fs=1/Ts;fsn=fs/(length(t)-1);
y11=10*log([y1 ones(length(fsn)-length(y1))]);l1=0:length(y11)-1;
figure(2);subplot(2,1,1);plot(l1.*1e8,y11./100);grid on;axis([0 2e10 0 1]);
xlabel('频率 [Hz]');ylabel('大小[dB]');
%自相关函数
figure(3);
n1=0:length(xcorr(x1,x1))-1;
subplot(2,1,1);plot(n1.*0.01e-9,xcorr(x1,x1));xlabel('时间[s]');ylabel('幅度[V]');
axis([0 2e-8 -500 600]);
title('二次相位的Chirp信号的自相关特性');
%互相关函数
figure(5);subplot(2,1,1);
n1=0:length(xcorr(x1,x12))-1;
subplot(2,1,1);plot(n1.*0.01e-9,xcorr(x1,x12));xlabel('时间[s]');ylabel('幅度[V]');
axis([0 2e-8 -100 100]);
%grid on;
title('二次相位的Chirp信号的互相关特性');
%Cubic-Phase Linear Chirp
x2=cos(2*pi*fc*t+0.67*pi*miu*t.^3/Ts);
x22=cos(2*pi*fc*t-0.67*pi*miu*t.^3/Ts);
figure(1);subplot(2,1,2);plot(t,x2);title('三次方相位的chirp信号');
axis([0 10e-9 -2 2]);grid on;
xlabel('时间[S]');ylabel('幅度[V]');
%频谱幅度
someg2=fft(x2);%y1=abs(someg1);
y2=(sqrt(((real(someg2).^2+imag(someg2).^2))/2));
fs=1/Ts;fsn=fs/(length(t)-1);
y21=10*log([y2 ones(length(fsn)-length(y2))]);l2=0:length(y21)-1;
figure(2);subplot(2,1,2);plot(l2.*1e8,y21./100);grid on;axis([0 3e10 0 1]);xlabel('频率 [Hz]');ylabel('大小[dB]');
%自相关函数
figure(3);subplot(2,1,2);
n2=0:length(xcorr(x2,x2))-1;
plot(n2.*0.01e-9,xcorr(x2,x2));xlabel('时间[s]');ylabel('幅度[V]');
axis([0 2e-8 -500 600]);
%grid on;
title('三次相位的线性Chirp信号的自相关特性');
%互相关函数
figure(5);subplot(2,1,2);
n2=0:length(xcorr(x2,x22))-1;
plot(n2.*0.01e-9,xcorr(x2,x22));xlabel('时间[s]');ylabel('幅度[V]');
axis([0 2e-8 -100 100]);
%grid on;
title('三次相位的线性Chirp信号的互相关特性');
%
figure(4);
fs=1/Ts;
f=(0:length(xcorr(x1,x1))-1)*0.01e9;
my=abs(fftshift(fft(xcorr(x1,x1))));
my=my/max(my);
my=10*log(my)./0.01e9;
plot(f,my-41.2);%axis([0 10e9 -90 -37])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -