《DSP using MATLAB》Problem 2.6

1、代码
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 2.6.1 \n\n'); [v, d] = version;
fprintf(' MATLAB Version: %20s\n\n', v);
fprintf(' Released Date: %17s\n\n', d); time_stamp = datestr(now, 31);
[wkd1, wkd2] = weekday(today, 'long');
fprintf(' Today is %7s, and Now is %20s \n\n', wkd2, time_stamp);
%% ------------------------------------------------------------------------ n = [0:9];
%x = stepseq(0,0,10) - stepseq(10,0,10);
x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
[xe,xo,m] = evenodd(x,n); figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
stem(n,x); title('x sequence ');
xlabel('n'); ylabel('x(n)') ;
% axis([-10,10,0,1.2])
grid on figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color',[1,1,1])
stem(m,xe); title('Even Part');
xlabel('n'); ylabel('xe(n)');
%axis([-10,10,0,1.2])
grid on figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color','white')
stem(m,xo); title('Odd Part');
xlabel('n'); ylabel('xo(n)');
%axis([-10,10,-0.6,0.6])
grid on
运行结果:




2、代码
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 2.6.2 \n\n'); [v, d] = version;
fprintf(' MATLAB Version: %20s\n\n', v);
fprintf(' Released Date: %17s\n\n', d); time_stamp = datestr(now, 31);
[wkd1, wkd2] = weekday(today, 'long');
fprintf(' Today is %7s, and Now is %20s \n\n', wkd2, time_stamp);
%% ------------------------------------------------------------------------ n = [-5:10];
x = exp(0.1 * n) .* (stepseq(-5,-5,10) - stepseq(10,-5,10)); [xe,xo,m] = evenodd(x,n); figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
stem(n,x); title('x sequence ');
xlabel('n'); ylabel('x(n)') ;
% axis([-10,10,0,1.2])
grid on figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color',[1,1,1])
stem(m,xe); title('Even Part');
xlabel('n'); ylabel('xe(n)');
%axis([-10,10,0,1.2])
grid on figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color','white')
stem(m,xo); title('Odd Part');
xlabel('n'); ylabel('xo(n)');
%axis([-10,10,-0.6,0.6])
grid on
运行结果:



3、代码
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 2.6.3 \n\n'); [v, d] = version;
fprintf(' MATLAB Version: %20s\n\n', v);
fprintf(' Released Date: %17s\n\n', d); time_stamp = datestr(now, 31);
[wkd1, wkd2] = weekday(today, 'long');
fprintf(' Today is %7s, and Now is %20s \n\n', wkd2, time_stamp);
%% ------------------------------------------------------------------------ n = [-20:20];
x = cos(0.2 * pi * n + pi/4); [xe,xo,m] = evenodd(x,n); figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
stem(n,x); title('x sequence ');
xlabel('n'); ylabel('x(n)') ;
% axis([-10,10,0,1.2])
grid on figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color',[1,1,1])
stem(m,xe); title('Even Part');
xlabel('n'); ylabel('xe(n)');
%axis([-10,10,0,1.2])
grid on figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color','white')
stem(m,xo); title('Odd Part');
xlabel('n'); ylabel('xo(n)');
%axis([-10,10,-0.6,0.6])
grid on
运行结果:



4、代码
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 2.6.4 \n\n'); [v, d] = version;
fprintf(' MATLAB Version: %20s\n\n', v);
fprintf(' Released Date: %17s\n\n', d); time_stamp = datestr(now, 31);
[wkd1, wkd2] = weekday(today, 'long');
fprintf(' Today is %7s, and Now is %20s \n\n', wkd2, time_stamp);
%% ------------------------------------------------------------------------ n = [0:100];
x = exp(-0.05 * n) .* sin(0.1 * pi * n + pi/3); [xe,xo,m] = evenodd(x,n); figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
stem(n,x); title('x sequence ');
xlabel('n'); ylabel('x(n)') ;
% axis([-10,10,0,1.2])
grid on figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color',[1,1,1])
stem(m,xe); title('Even Part');
xlabel('n'); ylabel('xe(n)');
%axis([-10,10,0,1.2])
grid on figure('NumberTitle', 'off', 'Name', 'Problem 2.6')
set(gcf,'Color','white')
stem(m,xo); title('Odd Part');
xlabel('n'); ylabel('xo(n)');
%axis([-10,10,-0.6,0.6])
grid on
运行结果:



《DSP using MATLAB》Problem 2.6的更多相关文章
- 《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窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- Linux系统——公网定制化yum仓库部署
1)搭建公网源yum仓库 安装wget aliyun源 # wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel ...
- 2016-2017 ACM-ICPC Pacific Northwest Regional Contest (Div. 1) Solution
A:Alphabet Solved. 签. #include<bits/stdc++.h> using namespace std; ]; ]; int main(){ scanf(); ...
- fileupload上传文件时带参数
var userID = ""; $('#picture').fileupload({ url: "http://localhost:35708/Handler/File ...
- windows 10占用cpu和内存过高
自从安装了windows 10,开机之后cpu和内存一直占用很高,尤其是system进程,一直占cpu在13%左右,上网查到一个解决方式,如下: cpu瞬间变为1%
- 来自MSDN的RibbonGadgets练习
来自MSDN的RibbonGadgets练习 RibbonGadgets是少见的来自官方的资源. 如果选择Menu Items = 集合,则会有向下的小箭头,同时会出现下来菜单. 这个都关系叫做gal ...
- linux及安全《Linux内核设计与实现》第四章——20135227黄晓妍
第四章 进程调度 进程调度程序是一个内核子系统 分配有限的处理器时间和资源 最大限度利用时间的原则(只要有可执行的进程,那么总会有进程执行) 基本工作:从一组处于等待(阻塞)状态的可执行进程中选择一个 ...
- Michael-Scott非阻塞队列(lock-free)算法的C实现
Michael-Scott非阻塞队列算法,即MS-queue算法,是1 9 9 6 年由Maged . M .Michael and M. L. Scott提出的,是最为经典的并发FIFO队列上的算法 ...
- 如何使用AngularJS对表单提交内容进行验证
AngularJS是一款优秀的前端JS框架,已经被用于Google的多款产品当中.它有着诸多特性,最为核心的是:MVC.模块化.自动化双向数据绑定.语义化标签.依赖注入等……使用它可以大大减少书写代码 ...
- struts1和struts2比较
- 设置WebApi里面命名空间参数
在这种情况下: 如果没有特别处理,会报: 所以要像MVC中的控制器一下配置一个命名空间参数,webapi里面没有自带这个功能 代码: using System; using System.Collec ...