a、

n = -2:10; x = [1:7,6:-1:1];                % generate x(n)
[x11,n11] = sigshift(x,n,5); [x12,n12] = sigshift(x,n,-4);
[x1,n1] = sigadd(2 * x11, n11, -3 * x12, n12); set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
stem(n,x); title('Sequence x(n)')
xlabel('n');ylabel('x(n)');
grid on figure % 新生成一张图
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
stem(n1,x1); title('Sequence in Example 2.2a')
xlabel('n'); ylabel('x1(n)');
grid on

b、

n = -2:10; x = [1:7,6:-1:1];                % generate x(n)
[x21,n21] = sigfold(x,n); [x21,n21] = sigshift(x21,n21,3);
[x22,n22] = sigshift(x,n,2); [x22,n22] = sigmult(x,n,x22,n22);
[x2,n2] = sigadd(x21, n21, x22, n22); % subplot(2,1,1);
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
stem(n,x); title('Sequence x(n)')
xlabel('n');ylabel('x(n)');
grid on; figure
set(gcf,'Color','white') % 新生成一张图
stem(n2,x2); title('Sequence in Example 2.2b')
xlabel('n'); ylabel('x2(n)');grid on;

  

不足之处,欢迎批评指正。

  

DSP using Matlab 示例Example2.2的更多相关文章

  1. DSP using MATLAB 示例Example2.12

    代码: b = [1]; a = [1, -0.9]; n = [-5:50]; h = impz(b,a,n); set(gcf,'Color','white'); %subplot(2,1,1); ...

  2. DSP using MATLAB 示例Example2.11

    上代码: b = [1]; a = [1, -1, 0.9]; n = [-20:120]; h = impz(b,a,n); set(gcf,'Color','white'); %subplot(2 ...

  3. DSP using MATlAB 示例Example2.10

    上代码 % noise sequence 1 x = [3, 11, 7, 0, -1, 4, 2]; nx = [-3:3]; % given signal x(n) [y,ny] = sigshi ...

  4. DSP using MATLAB 示例Example2.4

    n = [0:10]; x = stepseq(0,0,10) - stepseq(10,0,10); [xe,xo,m] = evenodd(x,n); set(gcf,'Color',[1,1,1 ...

  5. DSP using MATLAB 示例Example2.3

    n = [-10:1:10]; alpha = -0.1+0.3j; % x = exp(alpha*n); % subplot(2,1,1); set(gcf,'Color',[1,1,1]) % ...

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

  7. DSP using MATLAB 示例 Example3.19

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

  8. DSP using MATLAB示例Example3.18

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

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

随机推荐

  1. 【leetcode】Wildcard Matching(hard) ★ 大神太牛了

    Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. ...

  2. 【leetcode】Climbing Stairs (easy)

    You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb ...

  3. 【leetcode】Happy Number(easy)

    Write an algorithm to determine if a number is "happy". A happy number is a number defined ...

  4. LeetCode 441 Arranging Coins

    Problem: You have a total of n coins that you want to form in a staircase shape, where every k-th ro ...

  5. 常用邮箱的服务器(SMTP/POP3)地址和端口总结

    163.com: POP3服务器地址:pop.163.com(端口:110) SMTP服务器地址:smtp.163.com(端口:25) 126邮箱: POP3服务器地址:pop.126.com(端口 ...

  6. [Android Pro] Android libdvm.so 与 libart.so

    reference to :http://blog.csdn.net/koffuxu/article/details/44780351 Android libdvm.so 与 libart.so   ...

  7. Redis事件管理(一)

    Redis统一的时间管理器,同时管理文件事件和定时器, 这个管理器的定义: #if defined(__APPLE__) #define HAVE_TASKINFO 1 #endif /* Test ...

  8. 在web.xml中classpath和classpath*的区别

    classpath 和 classpath* 区别: classpath:只会到你指定的class路径中查找找文件; classpath*:不仅包含class路径,还包括jar文件中(class路径) ...

  9. chaper3_exerise_UVa455_周期串

    #include<iostream> #include<cstring> #include<stdio.h> using namespace std; ; int ...

  10. js递归

    先从外层往里调,再反. 要想明白,必须明白执行过程. 如果再不理解,就看函数功能.   函数里自己调自己就是递归!