《DSP using MATLAB》Problem 4.8
代码:
%% ----------------------------------------------------------------------------
%% 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的更多相关文章
- 《DSP using MATLAB》Problem 7.27
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.26
注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.25
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.24
又到清明时节,…… 注意:带阻滤波器不能用第2类线性相位滤波器实现,我们采用第1类,长度为基数,选M=61 代码: %% +++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.23
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info a ...
- 《DSP using MATLAB》Problem 7.16
使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.15
用Kaiser窗方法设计一个台阶状滤波器. 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.14
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.13
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.12
阻带衰减50dB,我们选Hamming窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- NHibernate 映射关系
基本映射关系如下: NHibernate类型 .NET类型 Database类型 备注 AnsiChar System.Char DbType.AnsiStringFixedLength - 1 ch ...
- HTML表单格式化
HTML表单格式化 一.说明 用table布局 二.效果 三.代码 <!DOCTYPE html> <html> <head> <title>Form. ...
- jsp动作之 forward
forward说明了,就想当于php的include,require函数.(但是它是跳转.forward之前的数据都不会显示) 这么说你明白了吗.就是包含,说的好听点就是跳转,但是url地址栏却是没有 ...
- Analysis of single cell RNA-seq data(单细胞终极课程)
业界良心啊,开源的单细胞课程. 随便看了几章,课程写得非常用心,非常适合新手. 课程地址:Analysis of single cell RNA-seq data 源码地址:hemberg-lab/s ...
- android--------自定义视频控件(视频全屏竖屏自动切换)
android播放视频也是常用的技术,今天分享一个自定义视频控件,支持自定义控制 UI,全屏播放, 可以实现自动横竖屏切换的控件,跟随手机的位置而,重力感应自动切换横竖屏. 效果图: 代码下载Gi ...
- service几种访问类型(集群外负载均衡访问LoadBalancer , 集群内访问ClusterIP,VPC内网负载均衡LoadBalancer ,集群外访问NodePort)
一.集群外访问(负载均衡) kind: ServiceapiVersion: v1spec: ports: - protocol: TCP port: 4341 targetPort: 8080 no ...
- python-day9-集合数据类型
pythons=['alex','egon','yuanhao','wupeiqi','gangdan','biubiu']linuxs=['wupeiqi','oldboy','gangdan'] ...
- spting Boot 创建一个springBoot项目
spting Boot 创建一个springBoot项目 1)学习springBoot使用软件:IDEA软件(前面的文章有安装idea的过程). 也可以使用另一种方法在https://start.sp ...
- PHP:第四章——PHP数组处理函数
<pre> <?php //数组处理函数 header("Content-Type:text/html;charset=utf-8"); //compact(); ...
- [转]VirtualBox中的网络连接方式详解
如果出现主机无法ping通虚拟机的情况,请首先确认虚拟机防火墙已关闭. 一.NAT模式 特点: 1.如果主机可以上网,虚拟机可以上网 2.虚拟机之间不能ping通 3.虚拟机可以ping通主机(此时p ...