⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example5_1.m

📁 经典《信号与系统》教程的matlab例程,对深入理解信号与系统相关概念有很大帮助
💻 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 + -