代码:

%% ----------------------------------------------------------------------------
%% 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. Codeforces 834D - The Bakery(dp+线段树)

    834D - The Bakery 思路:dp[i][j]表示到第j个数为止分成i段的最大总和值. dp[i][j]=max{dp[i-1][x]+c(x+1,j)(i-1≤x≤j-1)},c(x+1 ...

  2. SpringBoot中的数据库连接池

    内置的连接池 目前Spring Boot中默认支持的连接池有dbcp,dbcp2, tomcat, hikari三种连接池. 数据库连接可以使用DataSource池进行自动配置. 由于Tomcat数 ...

  3. 缓存地图 ArcGIS ——Local compact and exploded tile cache layer for WPF API

      ArcGISArcGIS 主页 特色 合约 图库 地图 组 帮助 我的内容 我的组织 登录 我的个人资料 帮助 管理员指南 登出 0 搜索全部内容 搜索地图 搜索图层 搜索应用程序 搜索工具 搜索 ...

  4. English trip -- VC(情景课) 6 A Time

    Words eleven  十一 twelve  十二 thirteen  十三 fourteen fifteen sixteen seventeen eighteen nineteen twenty ...

  5. Please, another Queries on Array? CodeForces - 1114F (线段树,欧拉函数)

    这题刚开始看成求区间$\phi$和了........先说一下区间和的做法吧...... 就是说将题目的操作2改为求$(\sum\limits_{i=l}^{r}\phi(a[i]))\%P$ 首先要知 ...

  6. python-day37--协程

    一. 协程介绍 单线程下实现并发,提升运行效率, 1.自己控制切换,保存状态 2.遇到I/O切         (单纯的CPU切没意义,只有在遇到I/O的时候切才有效率) 一句话说明什么是线程:协程是 ...

  7. 批量kill Linux环境下的任务

    批量kill Linux服务器的进程可以通过ps  grep  aws  xargs 进行结合来完成  比如要kill 全部test.sh 的进程 ps -ef |grep "test.sh ...

  8. OC MRC之set方法内存管理(代码分析)

    // // main.m // 03-set方法的内存管理 // // Created by apple on 13-8-9. // Copyright (c) 2013年 itcast. All r ...

  9. oracle增加表空间

    select tablespace_name, sum(bytes)/1024/1024 from dba_data_files group by tablespace_name; select ta ...

  10. write file to stroage trigger kernel warning

    when you write large files  to extern stroage, the kernel may have as follow context: [ 4560.236385] ...