代码:

%% ----------------------------------------------------------------------------
%% 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. m_Orchestrate learning system---三十三、公共变量多弄成全局变量

    m_Orchestrate learning system---三十三.公共变量多弄成全局变量 一.总结 一句话总结:比如班级id,小组id,这样省事,而且减少数据库的访问,加快访问速度,而且节约代码 ...

  2. SpringBoot+Mybatis-Generator自动生成

    原文链接 1.版本 Spring Boot 1.5.10 mybatis-generator-core 1.3.5 mybatis-generator-maven-plugin 1.3.5 2.项目目 ...

  3. [poj 3090]Visible Lattice Point[欧拉函数]

    找出N*N范围内可见格点的个数. 只考虑下半三角形区域,可以从可见格点的生成过程发现如下规律: 若横纵坐标c,r均从0开始标号,则 (c,r)为可见格点 <=>r与c互质 证明: 若r与c ...

  4. hdu 1024 最大M子段dp

    题目: Max Sum Plus Plus Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Ot ...

  5. 42. Trapping Rain Water *HARD*

    Given n non-negative integers representing an elevation map where the width of each bar is 1, comput ...

  6. Activiti工作流笔记(3)

    Activiti工作流的流程部署和删除流程部署 流程部署代码: /** * 部署流程 */ public class ActivitiTest { RepositoryService reposito ...

  7. CSS3提供的transition动画

    <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head>    < ...

  8. MyBatis:2

    转载:http://www.cnblogs.com/xrq730/p/5256221.html 前言 前一篇文章,讲了MyBatis入门,讲到了MyBatis有两个基本的配置文件,一个用来配置环境信息 ...

  9. golang channel本质——共享内存

    channel是golang中很重要的概念,配合goroutine是golang能够方便实现并发编程的关键.channel其实就是传统语言的阻塞消息队列,可以用来做不同goroutine之间的消息传递 ...

  10. 069——VUE中vuex之使用getters高效获取购物车商品总价

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...