代码:

%% ----------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 4.8 \n\n'); banner();
%% ---------------------------------------------------------------------------- %% -----------------------------------------------------
%% x3(n)=x1(n)*x2(n)
%% sigma(x3)=[sigma(x1)] [sigma(x2)]
%% -----------------------------------------------------
num = 10;
x1 = 0 + (2-0)*rand(1, 2*num+1);
n1 = [-num:num];
sum_x1 = sum(x1(:)) x2 = 0 + (2-0)*rand(1, 2*num+1);
n2 = [-num:num];
sum_x2 = sum(x2(:)) figure('NumberTitle', 'off', 'Name', 'Problem 4.8 Sequence x1 and x2');
set(gcf,'Color','white');
%hist(x1,x_axis);
subplot(2,1,1); stem(n1, x1);
title('Uniformly Distributed Random Numbers x1(n)');
xlabel('n'); ylabel('x1(n)'); grid on;
subplot(2,1,2); stem(n2, x2);
title('Uniformly Distributed Random Numbers x2(n)');
xlabel('n'); ylabel('x2(n)'); grid on; [x3, n3] = conv_m(x1, n1, x2, n2);
sum_x3 = sum(x3(:))
sum_chk = sum_x1 * sum_x2 figure('NumberTitle', 'off', 'Name', 'Problem 4.8 Sequence x3');
set(gcf,'Color','white');
%hist(x1,x_axis);
%subplot(2,1,1);
stem(n3, x3);
title('Sequence x3(n)=x1*x2 ');
xlabel('n'); ylabel('x3(n)'); grid on;

  运行结果:

《DSP using MATLAB》Problem 4.8的更多相关文章

  1. 《DSP using MATLAB》Problem 7.27

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

  2. 《DSP using MATLAB》Problem 7.26

    注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...

  3. 《DSP using MATLAB》Problem 7.25

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

  4. 《DSP using MATLAB》Problem 7.24

    又到清明时节,…… 注意:带阻滤波器不能用第2类线性相位滤波器实现,我们采用第1类,长度为基数,选M=61 代码: %% +++++++++++++++++++++++++++++++++++++++ ...

  5. 《DSP using MATLAB》Problem 7.23

    %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info a ...

  6. 《DSP using MATLAB》Problem 7.16

    使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  7. 《DSP using MATLAB》Problem 7.15

    用Kaiser窗方法设计一个台阶状滤波器. 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  8. 《DSP using MATLAB》Problem 7.14

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

  9. 《DSP using MATLAB》Problem 7.13

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

  10. 《DSP using MATLAB》Problem 7.12

    阻带衰减50dB,我们选Hamming窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

随机推荐

  1. C# 中的浅表副本与深表副本

    public class Student { public int age; public Student(int age) { this.age = age; } } public class Gr ...

  2. Windows Update 自动更新 设定 被锁(变灰)

    估计是McAfee自动更改掉的. 真TM烦人. 方法 1 不过找到了回复方法了: http://www.askvg.com/how-to-change-windows-update-settings- ...

  3. Xshell Xftp 免费版 (xshell6 评估期已过 解决办法)

    xshell6 评估期已过,因为下载的版本是evaluation版本,是有期限的. 大家可以修改为Home and school use 的版本,这样就不会出现这个提示了. 具体的操作步骤如下: 1. ...

  4. 雷林鹏分享:Ruby 判断

    Ruby 判断 Ruby 提供了其他现代语言中很常见的条件结构.在这里,我们将解释所有的条件语句和 Ruby 中可用的修饰符. Ruby if...else 语句 语法 if conditional ...

  5. English trip -- MC(情景课)3 D

    xu言: have a nice weekend... sentences How many people are there in you family? they are 3 people in ...

  6. 页面title改变浏览器兼容性问题

    前一阵子客户在界面上改了下小小的需求,需要点不同的文章title显示不同的模块名称(之前没有区分,统一叫新闻图片),很简单的一个需求但是测试的时候并没有注意到不兼容IE7和IE8.在客户那被尴尬的发现 ...

  7. splay训练

    1, CF 455D 2, CF 420D 3, CF 414E

  8. SqlDataReader的用法

    datareader对象提供只读单向数据的快速传递,单向:您只能依次读取下一条数据;只读:DataReader中的数据是只读的,不能修改;相对地,DataSet中的数据可以任意读取和修改 01.usi ...

  9. 44. Wildcard Matching *HARD*

    '?' Matches any single character. '*' Matches any sequence of characters (including the empty sequen ...

  10. img标签中alt属性与title属性在seo的作用-摘自网友

    img标签中alt属性与title属性作用,也许大家比较迷惑,现在给大家举例说明.alt属性是图片的替换文字.title属性规定元素的额外信息,有视觉效果. 目录 alt属性 title属性 ie和f ...