《DSP using MATLAB》Problem 2.9

代码:
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 2.9 \n\n'); banner();
%% ------------------------------------------------------------------------ nx = [0:1:20];
x = 0.9 .^ nx; ny = [-20:1:0];
y = 0.8 .^ (-ny); figure('NumberTitle', 'off', 'Name', 'Problem 2.9')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色 subplot(2,1,1); stem(nx, x); title('x sequence');
xlabel('n'); ylabel('x(n)') ;
grid on
subplot(2,1,2); stem(ny, y); title('y sequence');
xlabel('n'); ylabel('y(m)');
grid on; [x1, nx1] = sigfold(x, nx); % obtain x(-n)
[y1, ny1] = sigfold(y, ny); [Rxy, nxy] = conv_m(x1, nx1, y, ny);
[Rxx, nxx] = conv_m(x1, nx1, x, nx); figure('NumberTitle', 'off', 'Name', 'Problem 2.9')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色 subplot(2,1,1); stem(nxy, Rxy); title('Crosscorrelation Rxy(l) sequence');
xlabel('nxy'); ylabel('Rxy(nxy)') ;
grid on
subplot(2,1,2); stem(nxx, Rxx); title('Autocorrelation Rxx(l) sequence');
xlabel('nxx'); ylabel('Rxx(nxx)');
grid on;
运行结果:


《DSP using MATLAB》Problem 2.9的更多相关文章
- 《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窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- spring基础-01
IOC : inversion of 缩写, DI:dependency injection 即在调用者中注入被调用者的实例. AOP 面向切面编程,是代理模式的体现.spring默认使用JDK的动态 ...
- vue-router的hash模式与history模式的对比
Vue-router 中hash模式和history模式的关系在vue的路由配置中有mode选项 最直观的区别就是在url中 hash 带了一个很丑的 # 而history是没有#的mode:&quo ...
- python一段代码 感受一下
class T(): def aa(self): write = 1 print '123' class B(): def hehe(self) ...
- 经查-- git使用报错及解决办法
git push 错误 error: failed to push some refs to 'git@github.com:charblus/ ...' 本地和远程的文件应该合并后才能上传本地的新文 ...
- Log4j2报错ERROR StatusLogger Unrecognized format specifier
问题 使用maven-shade-plugin或者maven-assembly-plugin插件把项目打成一个可执行JAR包时,如果你引入了log4j2会出现如下问题: ERROR StatusLog ...
- 使用Python登陆QQ邮箱发送垃圾邮件 简单实现
参考:Python爱好者 知乎文章 需要做的是: 1.邮箱开启SMTP功能 2.获取授权码 上述两步百度都有. 源码: #!/usr/bin/env python from email.mime.te ...
- POJ 1159 Palindrome(最长公共子序列)
http://poj.org/problem?id=1159 题意: 给出一个字符串,计算最少要插入多少个字符可以使得该串变为回文串. 思路: 计算出最长公共子序列,再用原长-LCS=所要添加的字符数 ...
- c++ 字符串拷贝以及合并
#include<iostream> #include<string> using namespace std; class stringfun { ]; public: vo ...
- 理解flex布局
我们传统的布局方式是基于在盒子模型下的,依赖于display属性的,position属性的或者是float属性的,但是在传统的布局上面并不好布局; 比如我们想让某个元素垂直居中的话,我们常见的会让其元 ...
- JAVA异常处理分析高级进界(下)
既然Throwable是异常处理机制的核心,那么,我们就来分析下它的源码来看看它是如何实现的. 进行分析前,我们可以先想想如果让我们实现一个异常处理机制,我们需要它做什么? 1. 发生异常终止程序执行 ...