代码:

%% ----------------------------------------------------------
%% 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. codeforces Good Bye 2015 B. New Year and Old Property

    题目链接:http://codeforces.com/problemset/problem/611/B 题目意思:就是在 [a, b] 这个范围内(1 ≤ a ≤ b ≤ 10^18)统计出符合二进制 ...

  2. Mysql 基础 高级查询

    在西面内容中    car  和  nation   都表示 表名 1.无论 高级查询还是简单查询   都用  select.. from..语句   from  后面 加表名  可以使一张表也可以是 ...

  3. CSS中的ul与li样式详解

    CSS中的ul与li样式详解ul和li列表是使用CSS布局页面时常用的元素.在CSS中,有专门控制列表表现的属性,常用的有list-style-type属性.list-style-image属性.li ...

  4. August 23rd 2016 Week 35th Tuesday

    The very essence of romance is uncertainty. 浪漫的精髓就在于它充满种种可能. And the uncertainty of life may be also ...

  5. cookie的设置、获取以及删除

    首先介绍一下cookie的基本信息: cookie是以域为单位的,它必须放在服务器的的环境下,但是cookie的容量小,只有4kb,并且也不安全,还有入股cookie的名字相同,会修改或者覆盖原来的值 ...

  6. Eclipse启动时出现错误 An internal error occurred during: “Updating indexes”

    在Eclipse的workspace下有个.metadata文件夹,Eclipse出现异常的log文件就在这个目录下. 最近出现了这样的错误: 查看日志文件发现:     !ENTRY org.ecl ...

  7. jieba

    # coding: utf-8 # ###jieba特性介绍 # 支持三种分词模式: # 精确模式,试图将句子最精确地切开,适合文本分析: # 全模式,把句子中所有的可以成词的词语都扫描出来, 速度非 ...

  8. NYOJ题目114某种序列

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAscAAAHuCAIAAAD83zYaAAAgAElEQVR4nO3dP1LjygIv4LcJ5yyE2A

  9. iOS-OC-基本控件之UITextField

    UITextField IOS开发中必不可少的基本控件,本文主要是列出常用的属性及方法(注XCode版本为7.2) 文本框,可以理解为输入框或者显示框,即用户可以往里面输入文字或图片,可以输入当然也可 ...

  10. 《C#本质论》读书笔记(14)支持标准查询操作符的集合接口

      14.2.集合初始化器 使用集合初始化器,程序员可以采用和数组相似的方式,在集合的实例化期间用一套初始的成员来构造这个集合. 如果没有集合初始化器,就只有在集合实例化后才能显示添加到集合中--例如 ...