📄 dfs.m
字号:
n=-5:10;
x=0.5.^n.*(u(n)-u(n-5));
xs=0.5.^(n+5).*(u(n+5)-u(n))+0.5.^n.*(u(n)-u(n-5))+0.5.^(n-5).*(u(n-5)-u(n-10))+0.5.^(n-10).*(u(n-10)-u(n-15));
subplot(211)
stem(n,xs,'.')
title('The curve of a periodic sequence x(n)')
xlabel('Index n')
ylabel('The amplitude of x(n)')
k=-10:10;
w1=2*pi/5;
w=k*w1;
F=x*exp(-j*n'*w);
subplot(212)
stem(w,abs(F),'r.')
xlabel('Index w')
ylabel('The amplitude spectrum')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -