📄 example5_1.m
字号:
%==========================================================================
% Name:example5_1.m
% The program compute the DTFT of discrete-time sequence x(n),
% and plot the curves.
%==========================================================================
clear;close all,
n=-20:20;
x=0.5.^n.*u(n);%input('Type in x[n]=');
w1=2*pi;N=512;k=-N:N;
w=k*w1/(N);
X=x*exp(-j*n'*w);
X1=abs(X);
phi=57.3*angle(X);
subplot(221);stem(n,x,'.');
grid on;xlabel('Index n');
title('The sequence x[n]');
subplot(222);plot(w/(pi),X1);grid on;
title('The DTFT of sequence x[n]');
grid on;
subplot(224);
plot(w/(pi),phi,'r');grid on;
xlabel('w[*pi]');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -