DSP using MATLAB示例Example3.18
代码:
% 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的更多相关文章
- 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.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.16
代码: b = [0.0181, 0.0543, 0.0543, 0.0181]; % filter coefficient array b a = [1.0000, -1.7600, 1.1829, ...
- 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 ...
- 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 ...
- 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 , ...
随机推荐
- codeforces 500B.New Year Permutation 解题报告
题目链接:http://codeforces.com/problemset/problem/500/B 题目意思:给出一个含有 n 个数的排列:p1, p2, ..., pn-1, pn.紧接着是一个 ...
- BestCoder24 1001.Sum Sum Sum(hdu 5150) 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5150 题目意思:就是直接求素数. 不过 n = 1,也属于答案范围!!只能说,一失足成千古恨啊---- ...
- 更新补丁Bind
1.查询补丁版本信息 (1) rpm -qa|grep bind (2) dig @localhost version.bind 2.下载安装 BIND最新漏洞和升级解决办法 现在有非常多的公司的都有 ...
- IOS - 本地消息推送
第一步:创建本地推送 // 创建一个本地推送 UILocalNotification *notification = [[[UILocalNotification alloc] init] autor ...
- IOS-Gesture(手势识别)
手势识别——Gesture Recognizer •iOS3.2版本之后,苹果推出了手势识别(Gesture Recognizer),其目的是: –简化开发者的开发难度 –统一用户体验 • •iOS目 ...
- 数据库的日志数据库(_log.ldf)文件太大,如何压缩
DUMP TRANSACTION TCB WITH NO_LOGBACKUP LOG TCB WITH NO_LOGDBCC SHRINKDATABASE(TCB) 执行这三条语句就可以了,这里的TC ...
- Mac 下 gradle 路径
/Users/yourname/.gradle/wrapper/dists cmd:cd ~/.gradle/wrapper/dists/
- android中点击空白处隐藏软键盘
InputMethodManager manager manager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERV ...
- XPath的基本使用
XPath XPath 使用路径表达式来选取 XML 文档中的节点或节点集. 路径表达式 结果 bookstore 选取 bookstore 元素的所有子节点. /bookstore 选取根元素 bo ...
- 20145206邹京儒《Java程序设计》第3周学习总结
20145206 <Java程序设计>第3周学习总结 教材学习内容总结 第四章 4.1 定义类 class Clothes{ String color; char size; } publ ...