syms x;
fplot(fresnelc(x),[-4 4]);
hold on;
grid on;
fplot(fresnels(x),[-4 4],'--');
xlabel('x');
ylabel('Fresnel integrals:C(x),S(x)');
legend('C(x)','S(x)');
clear all;
close all;
clc;
%%%%%%%%%%线性调频信号的时域分析%%%%%%%%%%
TimeWidth=10e-6; %信号时宽
BandWidth=30e6; %信号带宽
Fs=80e6; %采样频率,个人理解:根据奈奎斯特采样定理,要求采样频率大于2倍的信号最高频率,而对于线性调频信号信号最高频率为F0+B
F0=5e6; %中频频率
N=fix(TimeWidth*Fs); %采样点数,fix函数向零方向取整
FFT_Len=2^nextpow2(N); %计算FFT的长度:为了提高FFT算法的性能,要求信号长度为2的幂
t=(0:N-1)/Fs;
st=cos(2*pi*F0*t+pi*(BandWidth/TimeWidth)*t.^2); %线性调频信号余弦表达式
figure;
subplot(3,1,1);
plot(t*1e6,st);
xlabel('时间/us');
title('线性调频信号');
f=F0+(BandWidth/TimeWidth)*t;
subplot(3,1,2);
plot(t*1e6,f);
xlabel('时间/us');
title('线性调频信号的频率');
phase=2*pi*F0*t+pi*(BandWidth/TimeWidth)*t.^2;
subplot(3,1,3);
plot(t*1e6,phase);
xlabel('时间/us');
title('线性调频信号的相位');
%%%%%%%%%%线性调频信号的频域分析%%%%%%%%%%
fs=(0:FFT_Len-1)*Fs/FFT_Len;
Sf=(fftshift(fft(st,FFT_Len)));
figure;
plot(fs*1e-6,abs(Sf));
xlabel('频率/MHz');
title('线性调频信号的幅度谱');