代码:

% Discrete-time Signal x1(n)
% Ts = 0.0002; n = -25:1:25; nTs = n*Ts; Fs = 1/Ts; x = exp(-1000*abs(nTs));
Ts = 0.001; n = -5:1:5; nTs = n*Ts; Fs = 1/Ts; x = exp(-1000*abs(nTs)); % Analog Signal
Dt = 0.00005; t = -0.005:Dt:0.005;
xa = x * sinc(Fs*(ones(length(n),1)*t - nTs'*ones(1,length(t)))) ; %% --------------------------------------------------------------------
%%
%% --------------------------------------------------------------------
figure('NumberTitle', 'off', 'Name', '<<DSP MATLAB>> Example3.21');
set(gcf,'Color','white');
subplot(1,1,1); plot(t*1000,xa); grid on; %axis([0,1,0,1.5]);
% title('Reconstructed Signal from x1(n) using sinc function');
title('Reconstructed Signal from x2(n) using sinc function');
xlabel('t in msec units.'); ylabel('xa(n)'); hold on;
% stem(n*Ts*1000,x); gtext('Ts=0.2 msec'); hold off;
stem(n*Ts*1000,x); gtext('Ts=1 msec'); hold off; % subplot(2,1,2); plot(w/pi, X); grid on; % axis([-1,1,-1,1]);
% title('Discrete-time Fourier Transform');
% xlabel('frequency in \pi units'); ylabel('X1(w)'); %% -------------------------------------------------------------------
%%
%% ------------------------------------------------------------------- % check
error = max(abs(xa - exp(-1000*abs(t))))

  运行结果:

DSP using MATLAB 示例Example3.21的更多相关文章

  1. DSP using MATLAB 示例 Example3.19

    代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Discrete-time Signa ...

  2. DSP using MATLAB示例Example3.18

    代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Continuous-time Fou ...

  3. 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 ...

  4. 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, ...

  5. 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 ...

  6. DSP using MATLAB 示例Example3.17

  7. 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 ...

  8. DSP using MATLAB 示例 Example3.13

    上代码: w = [0:1:500]*pi/500; % freqency between 0 and +pi, [0,pi] axis divided into 501 points. H = ex ...

  9. DSP using MATLAB 示例 Example3.12

    用到的性质 代码: n = -5:10; x = sin(pi*n/2); k = -100:100; w = (pi/100)*k; % freqency between -pi and +pi , ...

随机推荐

  1. 【leetcode】Reverse Linked List(easy)

    Reverse a singly linked list. 思路:没啥好说的.秒... ListNode* reverseList(ListNode* head) { ListNode * rList ...

  2. osg设置相机参数,包括初始位置

    严重注意!!!以下设置必须在viewer.realize();之后,否则不起作用!!!! 设置相机的位置,可以通过CameraManipulator(一般是osgGA::TrackballManipu ...

  3. 根据复选框checkbox的选中状态来打开或关闭隐藏层

    HTML:  <input type="checkbox" id="check-expert"> <div id="expert&q ...

  4. springmvc上传List,

    @RequestMapping("pay") public ModelAndView pay(String orderNo, TransactionDTO transaction, ...

  5. FragmentPagerAdapter实现刷新

    在fragmentpageadapter的instantiateItem方法里,他会先去FragmentManager里面去查找有没有相关的fragment如果有就直接使用如果没有才会触发fragme ...

  6. hdu 1290 切糕

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1290 思路: n条直线最多能将一个平面分成几个区域其递推公式即为:f(n)=f(n-1)+n:递推一下 ...

  7. 当ListView有Header时,onItemClick里的position不正确

    原文:http://blog.chengbo.net/2012/03/09/onitemclick-return-wrong-position-when-listview-has-headerview ...

  8. poj 2155:Matrix(二维线段树,矩阵取反,好题)

    Matrix Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 17880   Accepted: 6709 Descripti ...

  9. sqlplus 中spool命令的简单用法

    spool基本格式: spool 路径+文件名 select col1||','||col2||','||col3||','||col4||'..' from tablename; spool off ...

  10. CentOS下Apache安装SSL

    https是一个安全的访问方式,数据在传输过程中是加密的.https基于ssl. 一.安装apache和ssl模块1.安装apacheyum install httpd2.安装ssl模块yum ins ...