《DSP using MATLAB》示例Example4.5

Posted 沧海一粟

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了《DSP using MATLAB》示例Example4.5相关的知识,希望对你有一定的参考价值。

代码:

x1 = [1, 2, 3]; x2 = [2, 4, 3, 5];                    % x1 x2 sequences
% n1 = 0:1:2; n2 = 0:1:3;
n1 = -1:1:1; n2 = -2:1:1;

[x3, n3] = conv_m(x1, n1, x2, n2);

figure(\'NumberTitle\', \'off\', \'Name\', \'Example4.5 x1 & x2 sequence\')
set(gcf,\'Color\',\'white\'); 
subplot(2,1,1); stem(n1,x1); title(\'x1 sequence \');   xlabel(\'n\'); ylabel(\'x1(n)\'); grid on;
subplot(2,1,2); stem(n2,x2); title(\'x2 sequence \');   xlabel(\'n\'); ylabel(\'x2(n)\'); grid on;

figure(\'NumberTitle\', \'off\', \'Name\', \'Example4.5 x3 sequence\')
set(gcf,\'Color\',\'white\'); 
stem(n3,x3); title(\'x3 sequence\'); xlabel(\'n\'); ylabel(\'x3(n)\'); grid on;

  运行结果:

 

以上是关于《DSP using MATLAB》示例Example4.5的主要内容,如果未能解决你的问题,请参考以下文章

《DSP using MATLAB》示例Example 6.20

《DSP using MATLAB》示例Example5.17

《DSP using MATLAB》示例Example5.18

《DSP using MATLAB》示例Example5.21

DSP using MATLAB 示例Example3.17

《DSP using MATLAB》示例Example 8.8