代码:

x1 = [1,2,2,1]; x2 = [1,-1,-1,1];
x3 = conv(x1,x2); % N = 5 n1 = 0:1:length(x1)-1;
n2 = 0:1:length(x2)-1; n3 = 0:1:length(x3)-1; %% -----------------------------------------------------------------
%% START a
%% -----------------------------------------------------------------
figure('NumberTitle', 'off', 'Name', 'Exameple5.16a ')
set(gcf,'Color','white');
subplot(3,1,1); stem(n1,x1); title('sequence x1(n)'); axis([0,5,0,5]);
xlabel('n'); ylabel('x1(n)'); grid on;
subplot(3,1,2); stem(n2,x2); title('sequence x2(n)'); axis([0,5,0,5]);
xlabel('n'); ylabel('x2(n)'); grid on;
subplot(3,1,3); stem(n3,x3); title('Linear Convolution sequence x3(n)'); axis([0,10,-3,5]);
xlabel('n'); ylabel('x3(n)'); grid on; %% -----------------------------------------------------------------
%% END a
%% ----------------------------------------------------------------- x4 = circonvt(x1,x2,7); % N = 7 n4 = 0:1:length(x4)-1; %% -----------------------------------------------------------------
%% START b
%% -----------------------------------------------------------------
figure('NumberTitle', 'off', 'Name', 'Exameple5.16b ')
set(gcf,'Color','white');
subplot(3,1,1); stem(n1,x1); title('sequence x1(n)'); axis([0,5,0,5]);
xlabel('n'); ylabel('x1(n)'); grid on;
subplot(3,1,2); stem(n2,x2); title('sequence x2(n)'); axis([0,5,0,5]);
xlabel('n'); ylabel('x2(n)'); grid on;
subplot(3,1,3); stem(n4,x4); title('Circularly convolution sequence x4(n)'); axis([0,10,-3,5]);
xlabel('n'); ylabel('x4(n)'); grid on; %% -----------------------------------------------------------------
%% END b
%% -----------------------------------------------------------------

  运行结果:

《DSP using MATLAB》示例Example5.16的更多相关文章

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

  2. 《DSP using MATLAB》Problem5.16

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

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

  4. DSP using MATLAB 示例 Example3.19

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

  5. DSP using MATLAB示例Example3.18

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

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

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

  8. DSP using MATLAB 示例Example3.17

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

随机推荐

  1. Unity 小问题

    Cannot cast from source type to destination 我用Object 转 int 会出现这个错误提示 例如 : object p; int pp = (int)p; ...

  2. js 时间操作和随机数操作

    function Data() { var date = new Date(); var year = date.getFullYear(); ; var strDate = date.getDate ...

  3. WIN10 CMD 启动虚拟WIFI

    1.以管理员身份运行命令提示符: 快捷键win+R→输入cmd→回车 2.启用并设定虚拟WiFi网卡: 运行命令:netsh wlan set hostednetwork mode=allow ssi ...

  4. 浅谈:深入理解struts2的流程已经spring和struts2的整合

    第一步:在tomcat启动的时候 1.在tomcat启动的时候,首先会加载struts2的核心过滤器StrutsPrepareAndExecuteFilter <filter> <f ...

  5. ToString和Convert.ToString处理null值

    http://www.cnblogs.com/qinge/p/5687806.html文章来源 1.Convert.ToString能处理字符串为null的情况. 测试代码如下: 1 2 3 4 5 ...

  6. Google Map API V3开发(1)

    Google Map API V3开发(1) Google Map API V3开发(2) Google Map API V3开发(3) Google Map API V3开发(4) Google M ...

  7. C# GUID转换成16位字符串或19位数字并确保唯一

    /// <summary> /// 根据GUID获取16位的唯一字符串 /// </summary> /// <param name=\"guid\" ...

  8. [Head First设计模式]面向对象的3特征5原则

    系列文章 [Head First设计模式]山西面馆中的设计模式——装饰者模式 [Head First设计模式]山西面馆中的设计模式——观察者模式 [Head First设计模式]山西面馆中的设计模式— ...

  9. C#深入浅出 继承(六)

    这个标题写出来好长时间了,都没写内容,今天无论如何都得写完它,昨天写了一段,尼玛,电脑突然死机,重启之后啥都没了. 继承嘛,有人觉得很简单,但是里面还是有内容可以讲的,因为面向对象也就这么点内容,封装 ...

  10. 2014 Multi-University Training Contest 9#11

    2014 Multi-University Training Contest 9#11 Killing MonstersTime Limit: 2000/1000 MS (Java/Others)   ...