《DSP using MATLAB》示例Example5.16
代码:
x1 = [1,2,2,1]; x2 = [1,-1,-1,1];
x3 = conv(x1,x2); % N = 5 n1 = 0:1:length(x1)-1;
n2 = 0:1:length(x2)-1; n3 = 0:1:length(x3)-1; %% -----------------------------------------------------------------
%% START a
%% -----------------------------------------------------------------
figure('NumberTitle', 'off', 'Name', 'Exameple5.16a ')
set(gcf,'Color','white');
subplot(3,1,1); stem(n1,x1); title('sequence x1(n)'); axis([0,5,0,5]);
xlabel('n'); ylabel('x1(n)'); grid on;
subplot(3,1,2); stem(n2,x2); title('sequence x2(n)'); axis([0,5,0,5]);
xlabel('n'); ylabel('x2(n)'); grid on;
subplot(3,1,3); stem(n3,x3); title('Linear Convolution sequence x3(n)'); axis([0,10,-3,5]);
xlabel('n'); ylabel('x3(n)'); grid on; %% -----------------------------------------------------------------
%% END a
%% ----------------------------------------------------------------- x4 = circonvt(x1,x2,7); % N = 7 n4 = 0:1:length(x4)-1; %% -----------------------------------------------------------------
%% START b
%% -----------------------------------------------------------------
figure('NumberTitle', 'off', 'Name', 'Exameple5.16b ')
set(gcf,'Color','white');
subplot(3,1,1); stem(n1,x1); title('sequence x1(n)'); axis([0,5,0,5]);
xlabel('n'); ylabel('x1(n)'); grid on;
subplot(3,1,2); stem(n2,x2); title('sequence x2(n)'); axis([0,5,0,5]);
xlabel('n'); ylabel('x2(n)'); grid on;
subplot(3,1,3); stem(n4,x4); title('Circularly convolution sequence x4(n)'); axis([0,10,-3,5]);
xlabel('n'); ylabel('x4(n)'); grid on; %% -----------------------------------------------------------------
%% END b
%% -----------------------------------------------------------------
运行结果:
《DSP using MATLAB》示例Example5.16的更多相关文章
- DSP using MATLAB示例Example3.16
代码: b = [0.0181, 0.0543, 0.0543, 0.0181]; % filter coefficient array b a = [1.0000, -1.7600, 1.1829, ...
- 《DSP using MATLAB》Problem5.16
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- DSP using MATLAB 示例Example3.21
代码: % Discrete-time Signal x1(n) % Ts = 0.0002; n = -25:1:25; nTs = n*Ts; Fs = 1/Ts; x = exp(-1000*a ...
- DSP using MATLAB 示例 Example3.19
代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Discrete-time Signa ...
- DSP using MATLAB示例Example3.18
代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Continuous-time Fou ...
- DSP using MATLAB 示例Example3.23
代码: % Discrete-time Signal x1(n) : Ts = 0.0002 Ts = 0.0002; n = -25:1:25; nTs = n*Ts; x1 = exp(-1000 ...
- DSP using MATLAB 示例Example3.22
代码: % Discrete-time Signal x2(n) Ts = 0.001; n = -5:1:5; nTs = n*Ts; Fs = 1/Ts; x = exp(-1000*abs(nT ...
- DSP using MATLAB 示例Example3.17
- DSP using MATLAB 示例 Example3.15
上代码: subplot(1,1,1); b = 1; a = [1, -0.8]; n = [0:100]; x = cos(0.05*pi*n); y = filter(b,a,x); figur ...
随机推荐
- java单例的几种实现方法
java单例的几种实现方法: 方式1: public class Something { private Something() {} private static class LazyHolder ...
- redis之理解
http://www.cnblogs.com/stephen-liu74/category/354125.html
- 创建NetWorkDataset---FileGDB篇
/// <summary> /// 创建NetWorkDataset /// </summary> /// <returns>INetworkDataset.< ...
- sobel算子的一些细节
1. 形式 Gy 上下颠倒的 (*A表示卷积图像,忽略先): 看得出来,sobel算子感觉并不统一,特别是方向,我们知道matlab的图像格式是,x轴从左到右,y轴从上到下,原点在左上角. 所以,第二 ...
- 将javascript函数写在Html标签里
有些时候不想把函数写在script标签里了,想直接在html标签里直接加上js代码,可以这样写: <body onload="javascript:{window.location.h ...
- Rabbitmq Exchange Type 说明
Exchange在定义的时候是有类型的,以决定到底是哪些Queue符合条件,可以接收消息 fanout 所有bind到此exchange的queue都可以接收消息 direct 通过routingKe ...
- 深入理解IoC/DI
------------------------------------------------------------------------ 理解IoC/DI 1.控制反转 --> 谁控制谁 ...
- 以空白符结尾的 alias
网上经常有人问这个问题:为什么我写的 alias 在 sudo 下就不管用了? $ alias 'll=ls -l' $ sudo ll a-private-dir sudo: ll: command ...
- 什么时候用@Resource,什么时候用@service
Spring中什么时候用@Resource,什么时候用@service当你需要定义某个类为一个bean,则在这个类的类名前一行使用@Service("XXX"),就相当于讲这个类定 ...
- JSP分页显示
首先要定义四个变量: int pageSize: //每页显示多少条记录 int pageNow: //希望显示第几页 int pageCount: //一共有多少页 int rowCount: // ...