DSP using MATLAB 示例 Example3.10

用到的性质

上代码:
n = -5:10; x = rand(1,length(n)) + j * rand(1,length(n));
k = -100:100; w = (pi/100)*k; % freqency between -pi and +pi , [0,pi] axis divided into 101 points.
X = x * (exp(-j*pi/100)) .^ (n'*k); % DTFT of x % conjugation property
y = conj(x); % signal conjugation
Y = y * (exp(-j*pi/100)) .^ (n'*k); % DTFT of y magX = abs(X); angX = angle(X); realX = real(X); imagX = imag(X);
magY = abs(Y); angY = angle(Y); realY = real(Y); imagY = imag(Y); %verification
Y_check = conj(fliplr(X)); % conj(X(-w)) DTFT flip first, then conjugation
error = max(abs(Y-Y_check)); % Difference figure('NumberTitle', 'off', 'Name', 'x & y sequence')
set(gcf,'Color','white');
subplot(2,2,1); stem(n,real(x)); title('x sequence Real Part'); xlabel('n'); ylabel('Real x(n)'); grid on;
subplot(2,2,2); stem(n,imag(x)); title('x sequence Imaginary Part'); xlabel('n'); ylabel('Imaginary x(n))'); grid on;
subplot(2,2,3); stem(n,real(y)); title('y sequence Real Part'); xlabel('n'); ylabel('Real y(n)'); grid on;
subplot(2,2,4); stem(n,imag(y)); title('y sequence Imaginary Part'); xlabel('n'); ylabel('Imaginary y(n))'); grid on; %% ----------------------------------------------------------------
%% START Graphical verification
%% ----------------------------------------------------------------
figure('NumberTitle', 'off', 'Name', 'X Y compare theirs Magnitude and Angle');
set(gcf,'Color','white');
subplot(2,2,1); plot(w/pi,magX); grid on; axis([-1,1,0,12]);
xlabel('frequency in \pi units'); ylabel('|X|'); title('Magnitude of X ');
subplot(2,2,2); plot(w/pi,angX/pi); grid on; axis([-1,1,-1,1]);
xlabel('frequency in \pi units'); ylabel('Radians/\pi'); title('Angle of X '); subplot(2,2,3); plot(w/pi,magY); grid on; axis([-1,1,0,12]);
xlabel('frequency in \pi units'); ylabel('|Y|'); title('Magnitude of Y ');
subplot(2,2,4); plot(w/pi,angY/pi); grid on; axis([-1,1,-1,1]);
xlabel('frequency in \pi units'); ylabel('Radians/\pi'); title('Angle of Y '); %% ----------------------------------------------------------------
%% END Graphical verification
%% ----------------------------------------------------------------
运行结果:


DSP using MATLAB 示例 Example3.10的更多相关文章
- 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.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.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 , ...
- DSP using MATLAB 示例 Example3.11
用到的性质 上代码: n = -5:10; x = rand(1,length(n)); k = -100:100; w = (pi/100)*k; % freqency between -pi an ...
- DSP using MATLAB 示例Example3.8
代码: x = rand(1,11); n = 0:10; k = 0:500; w = (pi/500)*k; % [0,pi] axis divided into 501 points. X = ...
随机推荐
- code vs 1506 传话
codevs 1506 传话(时间限制: 1 s 空间限制: 128000 KB) 题目描述 Description 一个朋友网络,如果a认识b,那么如果a第一次收到某个消息,那么会把这个消息传给b, ...
- 【EM】C++代码实现
看了原理和比人的代码后,终于自己写了一个EM的实现. 我从网上找了一些身高性别的数据,用EM算法通过身高信息来识别性别. 实现的效果还行,正确率有84% (初始数据 男生170 女生160 方差都是1 ...
- python基础——sorted()函数
python基础——sorted()函数 排序算法 排序也是在程序中经常用到的算法.无论使用冒泡排序还是快速排序,排序的核心是比较两个元素的大小.如果是数字,我们可以直接比较,但如果是字符串或者两个d ...
- Android性能优化系列 + Android官方培训课程中文版
Android性能优化典范 - 第6季 http://hukai.me/android-performance-patterns-season-6/ Android性能优化典范 - 第5季 htt ...
- Delphi 的知识体系
第一部分 快速开发的基础 第1章 Delphi 5下的Windows编程 1 1.1 Delphi产品家族 1 1.2 Delphi是什么 3 1.2.1 可视化开 ...
- 排序练习【sdut 1582】【堆排序】
排序 Time Limit: 1000ms Memory limit: 32678K 有疑问?点这里^_^ 题目描述 给你N(N<=100)个数,请你按照从小到大的顺序输出. 输入 输入数 ...
- foreach与Iterable学习
以前对于foreach的使用都是自然而然的感觉,没有深究过为什么可以用,什么时候可以用.最近才发现,原来那些可以使用的类,都是实现了Iterable接口的,否则根本就不能用. 下面是我之前学习时候写的 ...
- <转>Java 常用排序算法小记
排序算法很多地方都会用到,近期又重新看了一遍算法,并自己简单地实现了一遍,特此记录下来,为以后复习留点材料. 废话不多说,下面逐一看看经典的排序算法: 1. 选择排序 选择排序的基本思想是遍历数组的过 ...
- hp,Qlogic,Brocade光纖卡查看方式
查看光纖卡類型 # lspci| grep Fibre 1. NHB棟 光纖卡brocade /sys/class/fc_host 查看光纖卡是否加載,若無,打驅動brocade_adapter_so ...
- TortoiseSVN常用操作说明
TortoiseSVN是windows下其中一个非常优秀的SVN客户端工具.通过使用它,我们可以可视化的管理我们的版本库.不过由于它只是一个客户端,所以它不能对版本库进行权限管理. TortoiseS ...