代码:

%% ----------------------------------------------------------
%% 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的更多相关文章

  1. 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 ...

  2. DSP using MATLAB 示例 Example3.19

    代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Discrete-time Signa ...

  3. DSP using MATLAB示例Example3.18

    代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Continuous-time Fou ...

  4. 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 ...

  5. 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 ...

  6. DSP using MATLAB 示例Example3.17

  7. 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, ...

  8. 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 ...

  9. 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 ...

  10. 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 , ...

随机推荐

  1. Hadoop 分布式文件系统:架构和设计

    引言 Hadoop分布式文件系统(HDFS)被设计成适合运行在通用硬件(commodity hardware)上的分布式文件系统.它和现有的分布式文件系统有很多共同点.但同时,它和其他的分布式文件系统 ...

  2. Maven实现直接部署Web项目到Tomcat7(转)

    转载自:http://my.oschina.net/angel243/blog/178554 以前在项目中很少使用Maven,最近自己学习了一下maven,真的是非常强大的项目构建工具,对于依赖包的定 ...

  3. 【linux】sudo su切换到root权限

    在用户有sudo权限但不知道root密码时可用 sudo su切换到root用户

  4. 20145213《Java程序设计》实验二Java面向对象程序设计实验报告

    20145213<Java程序设计>实验二Java面向对象程序设计实验报告 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装,继承,多态 初步掌握UML建模 熟悉S.O. ...

  5. 26. Remove Duplicates from Sorted Array

    题目: Given a sorted array, remove the duplicates in place such that each element appear only once and ...

  6. Alcatraz安装在xcode7失败执行下面代码

    1.步奏rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin 2.步奏 rm ...

  7. printf 打印 unit32_t

    今天在网上找了老半天终于找到了:printf 打印 uint32_t 类型  uint32_t domainId; printf("\ndomainId=========%lu", ...

  8. ios中通过调试来使用私有api

    转自:http://blog.csdn.net/cubepeng/article/details/11284173 OS不允许使用ios私有api,使用私有api可以获得意想不到的效果 ,同时使用私有 ...

  9. (1)第一个ASP.NET Web API

      Install-Package Microsoft.AspNet.WebApi . Global.asax protected void Application_Start() { AreaReg ...

  10. MVC公开课 – 1.基础 (2013-3-15广州传智MVC公开课)

      1.MVC设计模式 Model 是指 要处理的业务代码和数据操作代码 View 视图 主要是指的 跟用户打交道 并能够展示数据 Controller 看成是 Model和View的桥梁 优点: 1 ...