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 = ...
随机推荐
- CSS3 -web-box-shadow实现阴影效果
-webkit-box-shadow:2px -2px 10px #06c; 给元素添加阴影效果 text-shadow 是给文本添加阴影效果属性同上 形成的阴影跟阴影本体大小一致,四个属性分别代表 ...
- Jquery选中行实现行中的Checkbox的选中与取消选中
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs& ...
- sql的优化相关问题
这篇文章写的真心不错,值得仔细拜读,所以将其转载过来了. 一. 分析阶段 一 般来说,在系统分析阶段往往有太多需要关注的地方,系统各种功能性.可用性.可靠性.安全性需求往往吸引 ...
- 25个增强iOS应用程序性能的提示和技巧(中级篇)(3)
25个增强iOS应用程序性能的提示和技巧(中级篇)(3) 2013-04-16 14:42 破船之家 beyondvincent 字号:T | T 本文收集了25个关于可以提升程序性能的提示和技巧,分 ...
- .net 获取https页面的信息 在iis7.5服务器上不管用
让我纠结了一天多的问题,给大家看下,有相同情况的可以不用浪费时间了,本人当时找了好半天都没找到什么有用的信息,项目在本地没有问题,但部署在服务器后,获取不到https页面的信息,加入下面的代码就可以了 ...
- iOS 设备的屏幕尺寸一览
最近在做iPad开发项目 iPhone 设备: iPhone 1G --- 320x480iPhone 3G --- 320x480iPhone 3GS --- 320x480iPhone 4 --- ...
- C#学习笔记---协变和逆变
http://www.cnblogs.com/alphafly/p/4048608.html 协变是指方法能从委托的返回类型派生的一个类型. 逆变之方法获取的参数可以是委托参数类型的基类.
- CLR via C#(16)--泛型
泛型就像是一个模板,常常定义一些通用的算法,具体调用时再替换成实际的数据类型,提高了代码的可重用性. 一.初识泛型 1. 简单实例 以最常用的FCL中的泛型List<T >为例: stat ...
- Delphi基本数据类型---枚举、子界、集合、数组
参考:http://blog.csdn.net/qustdong/article/details/9230743 参考:http://www.cnblogs.com/xumenger/p/440222 ...
- attributeError:'module' object has no attribute ** 解决办法
写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...