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 = ...
随机推荐
- c++从文件中读取特定字符串问题的总结
1.每次从文件中读出一行作为一个字符串 可以用ifstream()函数来打开一个文件,然后用while加getline()函数即可每次读一行文件,直到文件结束 #include<unistd.h ...
- Android Shape自定义纯色圆角按钮
版权声明:分享技术,传播快乐.如果本博客对你有帮助,请在我的博客首页为我打赏吧! 在Android开发中,为响应美化应用中控件的效果,使用Shape定义图形效果,可以解决图片过多的问题. 首先看一下效 ...
- LeetCode 191 Number of 1 Bits
Problem: Write a function that takes an unsigned integer and returns the number of '1' bits it has ( ...
- [Android Pro] AIDL进程间传递自定义类型参数
1.创建.aidl 文件 AIDL 语法简单,用来声明接口,其中的方法接收参数和返回值,但是参数和返回值的类型是有约束的,且有些类型是需要 import,另外一些则无需这样做. AIDL 支持的数据类 ...
- JAVA addShutdownHook测试
public static void main(String[] args) { System.out.println("1111111111"); try { Thread.sl ...
- 在web.xml中classpath和classpath*的区别
classpath 和 classpath* 区别: classpath:只会到你指定的class路径中查找找文件; classpath*:不仅包含class路径,还包括jar文件中(class路径) ...
- hdu1018(数位)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1018 题意:求n!的数位(即n!有多少位): 思路:对于一个数x,它的数位ans=log10(x): ...
- hdu 5108 Alexandra and Prime Numbers
数论题,本质是求出n的最大质因子 #include<time.h> #include <cstdio> #include <iostream> #include&l ...
- jquery学习笔记----ajax使用
一.load() 加载页面数据 load(url,[data],[callback]) url:加载的页面地址,[data]传送的数据,[callback]加载完成时回调函数. 设计一个load.ht ...
- n的阶乘高精度算法【阶乘】
C语言实验——求阶乘(循环结构) Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 题目链接:http://acm.sdut.edu ...