《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 , ...
随机推荐
- DB2 SQLCODE 大全
DB2错误信息sqlcode sqlstate 说明 000 00000 SQL语句成功完成 01xxx SQL语句成功完成,但是有警告 +012 01545 未限定的列名被解释为一个有相互关系的引用 ...
- NEFU 503 矩阵求解 (非01异或的高斯消元)
题目链接 中文题,高斯消元模板题. #include <iostream> #include <cstdio> #include <cmath> #include ...
- 20145213《Java程序设计》第七周学习总结
20145213<Java程序设计>第七周学习总结 教材学习内容总结 周末快乐的时间总是短暂的,还没好好感受就到了要写博客的周日.有人喟叹时间都去哪儿了,那本周我们就来认识一下Java里的 ...
- 108. Convert Sorted Array to Binary Search Tree
题目: Given an array where elements are sorted in ascending order, convert it to a height balanced BST ...
- 高校排名 加强版(codevs 2799)
题目描述 Description 大学排名现在已经非常流行.在网上搜索可查到关于中国大学排行的各个方面的消息. 我们知道,在一大学里通常都由许多不同的"系"(专业)组成,比如计算机 ...
- mybatis配置问题
//当构造函数有多个参数时,可以使用constructor-arg标签的index属性,index属性的值从0开始. <bean id="sqlSession" class= ...
- php 租房子练习
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- sql server 对象资源管理器(一)
当需要查看具体数据库的所有用户表.存储过程等创建修改等脚本的时候,可以借用视图中的对象资源管理器的详细信息里面获取. 具体操作如下图所示:
- SVN 搭建
http://www.blogjava.net/jasmine214--love/archive/2010/09/26/332989.html http://hunan.iteye.com/blog/ ...
- java的final用法
转自:http://blog.163.com/maomaoyu_1012/blog/static/19060130520116269329894/ 1. 修饰基础数据成员的final ...