代码:

% Analog Signal
Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Continuous-time Fourier Transform
Wmax = 2*pi*2000;
K = 500; k = 0:1:K; % index array k for frequencies
W = k*Wmax/K; % freqency between 0 and +pi, [0,pi] axis divided into 501 points.
Xa = xa * exp(-j*t'*W) * Dt; magXa = abs(Xa); angXa = angle(Xa); realXa = real(Xa); imagXa = imag(Xa);
%% --------------------------------------------------------------------
%% START Xa's mag ang real imag
%% --------------------------------------------------------------------
figure('NumberTitle', 'off', 'Name', 'Example3.18 Xa its mag ang real imag');
set(gcf,'Color','white');
subplot(2,2,1); plot(W/pi,magXa); grid on; %axis([0,1,0,1.5]);
title('Magnitude Response');
xlabel('frequency in \pi units'); ylabel('Magnitude |Xa|');
subplot(2,2,3); plot(W/pi, angXa/pi); grid on; axis([-1,1,-1,1]);
title('Phase Response');
xlabel('frequency in \pi units'); ylabel('Radians/\pi'); subplot('2,2,2'); plot(W/pi, realXa); grid on;
title('Real Part');
xlabel('frequency in \pi units'); ylabel('Real');
subplot('2,2,4'); plot(W/pi, imagXa); grid on;
title('Imaginary Part');
xlabel('frequency in \pi units'); ylabel('Imaginary');
%% -------------------------------------------------------------------
%% END Xa's mag ang real imag
%% ------------------------------------------------------------------- Xa = real(Xa); W = [-fliplr(W), W(2:501)]; % Omega from -Wmax to Wmax
Xa = [fliplr(Xa), Xa(2:501)]; % Xa over -Wmax to Wmax interval %% --------------------------------------------------------------------
%%
%% --------------------------------------------------------------------
figure('NumberTitle', 'off', 'Name', 'DSP MATLAB Example3.18');
set(gcf,'Color','white');
subplot(2,1,1); plot(t*1000,xa); grid on; %axis([0,1,0,1.5]);
title('Analog Signal');
xlabel('t in msec units.'); ylabel('xa(t)');
subplot(2,1,2); plot(W/(2*pi*1000), Xa*1000); grid on; % axis([-1,1,-1,1]);
title('Continuous-time Fourier Transform');
xlabel('frequency in KHz'); ylabel('Xa(jW)*1000'); %% -------------------------------------------------------------------
%%
%% -------------------------------------------------------------------

  运行结果:

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

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

  2. DSP using MATLAB 示例 Example3.19

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

  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. html 中绑定事件 this的指向

    var m=function(){ alert(2);    }    var obj={        A:function(){        },        m:function(){    ...

  2. JSP公用COMMON文件

    head.jsp: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" ...

  3. NIS域配置详解

    一.前期准备1.1 NIS 简介NIS,英文的全称是network information service,也叫yellow pages.在Linux中,NIS是一个基于RPC的client/serv ...

  4. xmpp笔记2(客户端到服务器的例子)--xml

    xmpp( 客户端到服务器的例子 ) 1 步:客户端初始流给服务器: <stream:stream xmlns='jabber:client' xmlns:stream='http://ethe ...

  5. July 5th, Week 28th Tuesday, 2016

    If you smile when no one else is around, you really mean it. 独处的时候你的笑容才是发自内心的笑容. Human beings are so ...

  6. Warp divergence

    Threads are executed in warps of 32, with all threads in the warp executing the same instruction at ...

  7. php 投票系统练习

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  8. Jquery.Datatables 结合时间段查询,daterangepicker实现Datatables表格带参数查询

      参考:http://datatables.club/example/user_share/send_extra_param.html   下载地址:http://pan.baidu.com/s/1 ...

  9. Delphi字符串与字符数组之间的转换(初始化的重要性)

    紧接着上篇博客讲解的内容: 将Char型数组转换为string类型还有下面的这种方法 但是我在测试的时候遇到了一些问题,并在下面进行了解释和总结 先说出我的总结 其实我们在学习编程的时候(比如我之前学 ...

  10. Go 中的反射要点

    简介 反射是元数据编程的一种形式,指的是程序获得本身结构的一种能力.不同语言的反射模型实现不一样,本文中的反射,仅仅指的是Go语言中的反射模型. 类型以及接口 这个基本概念需要清晰,这里不详细展开. ...