《DSP using MATLAB》Problem 3.7
一个复数序列可以分解为共轭偶对称和共轭奇对称部分。
代码:
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 3.7 \n\n'); banner();
%% ------------------------------------------------------------------------
n_start = -10; n_end = 20;
n = [n_start:n_end];
x = 2 * (0.9 .^(-n)) .* (cos(0.1*pi*n) + j*sin(0.9*pi*n)) .* (stepseq(0, n_start, n_end)-stepseq(10, n_start, n_end)); [xe,xo,m] = evenodd_cv(x,n); figure('NumberTitle', 'off', 'Name', 'Problem 3.7 x(n)')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
subplot(2,1,1); stem(n, real(x)); title('x sequence Real Part');
xlabel('n'); ylabel('Real[x(n)]') ;
% axis([-10,10,0,1.2])
grid on
subplot(2,1,2); stem(n, imag(x)); title('x sequence Imag Part');
xlabel('n'); ylabel('Imag[x(n)]');
grid on; figure('NumberTitle', 'off', 'Name', 'Problem 3.7 xe(m)')
set(gcf,'Color',[1,1,1])
subplot(2,1,1); stem(m, real(xe)); title('Real Part of Even Sequence');
xlabel('m'); ylabel('Real[xe(m)]');
%axis([-10,10,0,1.2])
grid on
subplot(2,1,2); stem(m, imag(xe)); title('Imag Part of Even Sequence');
xlabel('m'); ylabel('Imag[xe(m)]');
%axis([-10,10,0,1.2])
grid on figure('NumberTitle', 'off', 'Name', 'Problem 3.7 xo(m)')
set(gcf,'Color','white')
subplot(2,1,1); stem(m, real(xo)); title('Real Part of Odd Sequence');
xlabel('m'); ylabel('Real[xo(m)]');
%axis([-10,10,0,1.2])
grid on
subplot(2,1,2); stem(m, imag(xo)); title('Imag Part of Odd Sequence');
xlabel('m'); ylabel('Imag[xo(m)]');
%axis([-10,10,0,1.2])
grid on % ----------------------------------------------
% DTFT of x(n)
% ---------------------------------------------- MM = 500;
k = [-MM:MM]; % [-pi, pi]
%k = [0:M]; % [0, pi]
w = (pi/MM) * k; [X] = dtft(x, n, w); magX = abs(X); angX = angle(X); realX = real(X); imagX = imag(X); figure('NumberTitle', 'off', 'Name', 'Problem 3.7 DTFT of x(n)');
set(gcf,'Color','white');
subplot(2,1,1); plot(w/pi, magX); grid on;
title('Magnitude Part');
xlabel('frequency in \pi units'); ylabel('Magnitude');
subplot(2,1,2); plot(w/pi, angX); grid on;
title('Angle Part');
xlabel('frequency in \pi units'); ylabel('Radians'); figure('NumberTitle', 'off', 'Name', 'Problem 3.7 Real and Imag of X(jw)');
set(gcf,'Color','white');
subplot('2,1,1'); plot(w/pi, realX); grid on;
title('Real Part');
xlabel('frequency in \pi units'); ylabel('Real');
subplot('2,1,2'); plot(w/pi, imagX); grid on;
title('Imaginary Part');
xlabel('frequency in \pi units'); ylabel('Imaginary'); % ---------------------------------------------------
% DTFT of xe(m)
% --------------------------------------------------- MM = 500;
k = [-MM:MM]; % [-pi, pi]
%k = [0:M]; % [0, pi]
w = (pi/MM) * k; [XE] = dtft(xe, m, w); magXE = abs(XE); angXE = angle(XE); realXE = real(XE); imagXE = imag(XE); figure('NumberTitle', 'off', 'Name', 'Problem 3.7 DTFT of xe(m)');
set(gcf,'Color','white');
subplot(2,1,1); plot(w/pi, magXE); grid on;
title('Magnitude Part');
xlabel('frequency in \pi units'); ylabel('Magnitude');
subplot(2,1,2); plot(w/pi, angXE); grid on;
title('Angle Part');
xlabel('frequency in \pi units'); ylabel('Radians'); figure('NumberTitle', 'off', 'Name', 'Problem 3.7 Real and Imag of XE(jw)');
set(gcf,'Color','white');
subplot('2,1,1'); plot(w/pi, realXE); grid on;
title('Real Part');
xlabel('frequency in \pi units'); ylabel('Real');
subplot('2,1,2'); plot(w/pi, imagXE); grid on;
title('Imaginary Part');
xlabel('frequency in \pi units'); ylabel('Imaginary'); % ---------------------------------------------------
% DTFT of xo(m)
% --------------------------------------------------- MM = 500;
k = [-MM:MM]; % [-pi, pi]
%k = [0:M]; % [0, pi]
w = (pi/MM) * k; [XO] = dtft(xo, m, w); magXO = abs(XO); angXO = angle(XO); realXO = real(XO); imagXO = imag(XO); figure('NumberTitle', 'off', 'Name', 'Problem 3.7 DTFT of xo(m)');
set(gcf,'Color','white');
subplot(2,1,1); plot(w/pi, magXO); grid on;
title('Magnitude Part');
xlabel('frequency in \pi units'); ylabel('Magnitude');
subplot(2,1,2); plot(w/pi, angXO); grid on;
title('Angle Part');
xlabel('frequency in \pi units'); ylabel('Radians'); figure('NumberTitle', 'off', 'Name', 'Problem 3.7 Real and Imag of XO(jw)');
set(gcf,'Color','white');
subplot('2,1,1'); plot(w/pi, realXO); grid on;
title('Real Part');
xlabel('frequency in \pi units'); ylabel('Real');
subplot('2,1,2'); plot(w/pi, imagXO); grid on;
title('Imaginary Part');
xlabel('frequency in \pi units'); ylabel('Imaginary'); % ------------------------------------------
% Verify
% ------------------------------------------
figure('NumberTitle', 'off', 'Name', 'Problem 3.7 RealX and RealXE');
set(gcf,'Color','white');
subplot('2,1,1'); plot(w/pi, realX); grid on;
title('Real Part of X(jw)');
xlabel('frequency in \pi units'); ylabel('Real');
subplot('2,1,2'); plot(w/pi, realXE); grid on;
title('Real Part of XE(jw)');
xlabel('frequency in \pi units'); ylabel('Real'); figure('NumberTitle', 'off', 'Name', 'Problem 3.7 ImagX and ImagXO');
set(gcf,'Color','white');
subplot('2,1,1'); plot(w/pi, imagX); grid on;
title('Imaginary Part of X(jw)');
xlabel('frequency in \pi units'); ylabel('Imaginary');
subplot('2,1,2'); plot(w/pi, imagXO); grid on;
title('Imaginary Part of XO(jw)');
xlabel('frequency in \pi units'); ylabel('Imaginary');
运行结果:
1、原始序列,及其共轭奇偶分解(都是复数序列);
2、原始序列的DTFT,幅度谱和相位谱,实部和虚部;
3、共轭偶(奇)对称序列的DTFT
4、共轭奇对称序列的DTFT
5、结论
原始序列谱的实部和共轭偶对称序列的谱相同;
原始序列谱的虚部和共轭奇对称序列的谱相同;
《DSP using MATLAB》Problem 3.7的更多相关文章
- 《DSP using MATLAB》Problem 7.27
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.26
注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.25
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.24
又到清明时节,…… 注意:带阻滤波器不能用第2类线性相位滤波器实现,我们采用第1类,长度为基数,选M=61 代码: %% +++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.23
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info a ...
- 《DSP using MATLAB》Problem 7.16
使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.15
用Kaiser窗方法设计一个台阶状滤波器. 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.14
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.13
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.12
阻带衰减50dB,我们选Hamming窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- Hibernate实例
Hibernate实例 一.Hibernate简介 Hibernate是简化项目中连接数据库的一个框架工具 Hibernate是Java领域类技术成熟稳定的ORM框架 * ORM是对象关系映射 * 使 ...
- WPF PasswordBox.Password 的数据绑定
WPF的PasswordBox控件的Password属性不是依赖属性,无法直接进行数据绑定,为使其在MVVM模式中正常使用,可以为PasswordBox增加一个助手类,代码如下: 注:代码摘自:htt ...
- JS-Object (3) JSON; Event Object相关知识(事件冒泡,事件监听, stopPropagation()
通常用于在网站上表示和传输数据 使用JavaScript处理JSON的所有工作,包括访问JSON对象中的数据项并编写自己的JSON. JSON text基本上就像是一个JavaScript对象,这句话 ...
- codeforces 853b//Jury Meeting// Codeforces Round #433 (Div. 1)
题意:几个人要去一个城市k天,现给出各航班的日期和花费,让这n个人能相会k天的最小花费? 用数组arr1[i]记录在第i天人到齐的最小花费.arr2[i]记录第i天之后才有人开始走的最小花费.然后取a ...
- devilbox(二):连接数据库
Devilbox的安装在上一篇https://www.cnblogs.com/ermao0423/p/9505653.html中已经记录了,这篇主要记录各种数据库的连接.用户建立.设置密码等 查看do ...
- Jenkins install
Linux CentOS 7.1 x64 Java 1.8 x64 apache-maven-3.3.9 Installation sudo wget -O /etc/yum.repos.d/jenk ...
- Tips for Sync Vimtex and PDF
vimtex synctex: \lv. skim synctex: to display the TeX source line corresponding to a point in the PD ...
- OC Foundation框架—字符串
一.Foundation框架中一些常用的类 字符串型: NSString:不可变字符串 NSMutableString:可变字符串 集合型: 1) NSArray:OC不可变数组 NSMutableA ...
- 李阳音标速成MP3文本
第一节:前元音 No. 1 [i:]穿针引线长衣音,简称"长衣音" 字母:e字母:ee 字母:ea字母:ie字母:ei 其发音要领是发音时舌尖抵下齿,前舌尽量抬高.舌位高于/i/: ...
- Tarjan 算法求强联通分量
转载自:http://blog.csdn.net/xinghongduo/article/details/6195337 还是没懂Tarjan算法的原理.但是感觉.讲的很有道理. 说到以Tarjan命 ...