?? ctft_develope.m
字號:
% ======================================================================
% ctft_develope.m
%========================================================================
clear,close all
t1=20;%input('Type in the time range:');
p=0.004;
f=1/2;% Hz
t=-t1:p:t1; T=8;
tao=0.5;
x1=u(t+tao)-u(t-tao); x=0;
for i=-t1:t1;
x=x+u(t-i*T+tao)-u(t-i*T-tao);
end
N=20*T/2;
L=2*N+1; k=-N:N;
w=-10:0.01:10;
X=sinc(w);
for r=1:L;
an(r)=(1/T)*x1*exp(-j*((-(L-1)/2+r-1)*2*pi/T)*t')*p;
end
an=an*T;
subplot(211)
plot(t,x)
axis([-T,T,-0.2,1.2])
title('The original signal x(t)')
xlabel('Time t')
subplot(212)
k=-N:N;
stem(k,an,'r.'),hold on
text(4,max(an),'The amplitude T*ak of x(t)')
plot(T*w,X)
axis([-N,N,-0.5*max(abs(an)),1.2*max(abs(an))])
xlabel('Frequency index k')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -