%% 1.生产仿真信号
fs = 1e3;
t = 0:1/fs:1-1/fs;
x = 6*t.^2 + cos(4*pi*t+10*pi*t.^2) + ...
[cos(60*pi*(t(t<=0.5))) cos(100*pi*(t(t>0.5)-10*pi))];
figure('color','w')
tiledlayout('flow')
nexttile
plot(t,[zeros(1,length(t)/2) cos(100*pi*(t(length(t)/2+1:end))-10*pi)])
xlabel('Time (s)')
ylabel('Cosine')
nexttile
plot(t,[cos(60*pi*(t(1:length(t)/2))) zeros(1,length(t)/2)])
xlabel('Time (s)')
ylabel('Cosine')
nexttile
plot(t,cos(4*pi*t+10*pi*t.^2))
xlabel('Time (s)')
ylabel('Chirp')
nexttile
plot(t,6*t.^2)
xlabel('Time (s)')
ylabel('Quadratic trend')
nexttile(5,[1 2])
plot(t,x)
xlabel('Time (s)')
ylabel('Signal')