《DSP using MATLAB》示例Example5.5

代码:
%% ----------------------------------------------------------
%% START N=5
%% ----------------------------------------------------------
N = 5; k = 0:1:N-1; % sample index
wk = 2*pi*k/N; zk = exp(j*wk); % samples of z
Xk = (zk)./(zk-0.7); % DFS as samples of X(z)
xn = real(idfs(Xk,N)); % IDFS
xtilde = xn'*ones(1,8); xtilde = (xtilde(:))'; % Periodic sequence figure('NumberTitle', 'off', 'Name', 'Example5.5')
set(gcf,'Color','white');
subplot(2,2,1); stem(0:39, xtilde); axis([0, 40, -0.1, 1.5]);
xlabel('n'); ylabel('xtilde(n)'); grid on;
title('N=5');
%% -----------------------------------------------------------
%% END N=5
%% ----------------------------------------------------------- %% ----------------------------------------------------------
%% START N=10
%% ----------------------------------------------------------
N = 10; k = 0:1:N-1; % sample index
wk = 2*pi*k/N; zk = exp(j*wk); % samples of z
Xk = (zk)./(zk-0.7); % DFS as samples of X(z)
xn = real(idfs(Xk,N)); % IDFS
xtilde = xn'*ones(1,4); xtilde = (xtilde(:))'; % Periodic sequence subplot(2,2,2); stem(0:39, xtilde); axis([0, 40, -0.1, 1.5]);
xlabel('n'); ylabel('xtilde(n)'); grid on;
title('N=10');
%% ----------------------------------------------------------
%% END N=10
%% ---------------------------------------------------------- %% ----------------------------------------------------------
%% START N=20
%% ----------------------------------------------------------
N = 20; k = 0:1:N-1; % sample index
wk = 2*pi*k/N; zk = exp(j*wk); % samples of z
Xk = (zk)./(zk-0.7); % DFS as samples of X(z)
xn = real(idfs(Xk,N)); % IDFS
xtilde = xn'*ones(1,2); xtilde = (xtilde(:))'; % Periodic sequence subplot(2,2,3); stem(0:39, xtilde); axis([0, 40, -0.1, 1.5]);
xlabel('n'); ylabel('xtilde(n)'); grid on;
title('N=20');
%% ----------------------------------------------------------
%% END N=20
%% ---------------------------------------------------------- %% ----------------------------------------------------------
%% START N=40
%% ----------------------------------------------------------
N = 40; k = 0:1:N-1; % sample index
wk = 2*pi*k/N; zk = exp(j*wk); % samples of z
Xk = (zk)./(zk-0.7); % DFS as samples of X(z)
xn = real(idfs(Xk,N)); % IDFS
xtilde = xn'*ones(1,1); xtilde = (xtilde(:))'; % Periodic sequence subplot(2,2,4); stem(0:39, xtilde); axis([0, 40, -0.1, 1.5]);
xlabel('n'); ylabel('xtilde(n)'); grid on;
title('N=40');
%% ----------------------------------------------------------
%% END N=40
%% ----------------------------------------------------------
运行结果:

《DSP using MATLAB》示例Example5.5的更多相关文章
- DSP using MATLAB 示例Example3.21
代码: % Discrete-time Signal x1(n) % Ts = 0.0002; n = -25:1:25; nTs = n*Ts; Fs = 1/Ts; x = exp(-1000*a ...
- DSP using MATLAB 示例 Example3.19
代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Discrete-time Signa ...
- DSP using MATLAB示例Example3.18
代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Continuous-time Fou ...
- DSP using MATLAB 示例Example3.23
代码: % Discrete-time Signal x1(n) : Ts = 0.0002 Ts = 0.0002; n = -25:1:25; nTs = n*Ts; x1 = exp(-1000 ...
- DSP using MATLAB 示例Example3.22
代码: % Discrete-time Signal x2(n) Ts = 0.001; n = -5:1:5; nTs = n*Ts; Fs = 1/Ts; x = exp(-1000*abs(nT ...
- DSP using MATLAB 示例Example3.17
- DSP using MATLAB示例Example3.16
代码: b = [0.0181, 0.0543, 0.0543, 0.0181]; % filter coefficient array b a = [1.0000, -1.7600, 1.1829, ...
- DSP using MATLAB 示例 Example3.15
上代码: subplot(1,1,1); b = 1; a = [1, -0.8]; n = [0:100]; x = cos(0.05*pi*n); y = filter(b,a,x); figur ...
- DSP using MATLAB 示例 Example3.13
上代码: w = [0:1:500]*pi/500; % freqency between 0 and +pi, [0,pi] axis divided into 501 points. H = ex ...
- DSP using MATLAB 示例 Example3.12
用到的性质 代码: n = -5:10; x = sin(pi*n/2); k = -100:100; w = (pi/100)*k; % freqency between -pi and +pi , ...
随机推荐
- IOS - 控件的AutoresizingMask属性
在 UIView 中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高. enum { UIViewAutoresi ...
- php数据访问增删查
1.先做一个登陆界面 <form action="chuli.php" method="post"> <div>用户名:<inpu ...
- osg::NodeVisitor中计算一个节点对应的世界变换矩阵、法向量、顶点坐标
class MyNodeVisitor:public osg::NodeVisitor { pulic: MyNodeVisitor():osg::NodeVisitor(osg::NodeVisit ...
- a标签的妙用-拨打电话、发送短信、发送邮件
前端时间在做手机WAP网站时,遇到需要点击页面上显示的电话号能直接拨号的需求,查找资料发现可以使用html的a标签完美实现该需求!记录下来以备后用...... 目前主流手机浏览器对H5的支持已经很不错 ...
- 利用颜色生成UIImage
// 颜色转换为背景图片 + (UIImage *)imageWithColor:(UIColor *)color { CGRect rect = CGRectMake(0.0f, 0.0f, 1. ...
- Javascript 封装方法
基本封装方法 请看下面的例子: var Person = function(name,age){ this.name = name; this.age = age || "未填写" ...
- Mysql之复制选项与监控
1.Slave 筛选选项: --replicate-do-db ,同步复制哪些库 --replicate-ignore-db,忽略哪些库 --replicate-do-table=db_name.t ...
- Android Hybrid开发
参考:谈谈Android App混合开发 Html 5和Native的交互 WebView 本来就支持js和Java相互调用,你只需要开启 WebView 的JavaScript脚本执行, 然后通过代 ...
- css设置网页文本选中样式
网页的默认的文本选中颜色是蓝底白字(大多应该是吧),这个样子: 感觉并不是特别好看,可以通过CSS3的一个特性,一个CSS3的伪类选择器::selection来设置文本被选中时的状态,比如本博客的主题 ...
- C#回顾 - 3.NET的IO:字节流
使用 Stream 类管理字节流 使用 FileStream 类管理文件数据 使用 MemoryStream 类管理内存数据 使用 BufferedSream 类提高流性能 3.1 FileStr ...