《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窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- Html概述
Html概述 主要思想,主要思想很重要 一.Html是什么 一种标记语言(用标签进行标记) 对要显示的文字进行标记 二.Html核心 标签(只认标签) 封装,所以必须有头尾,你才知道标签的范围,你才知 ...
- Connecting Vertices CodeForces - 888F (图论,计数)
链接 大意: 给定邻接表表示两点是否可以连接, 要求将图连成树, 且边不相交的方案数 n范围比较小, 可以直接区间dp $f[l][r]$表示答案, $g[l][r]$表示区间[l,r]全部连通且l, ...
- Android studio的 repositories配置多个url
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2. ...
- 根据条件设置poplist的值集
需求:在当前页面的pageButtonBar中有一个下拉选择框,选择框中的值集根据某些条件有不同. public class SupplierInfoReviewCO extends OAContro ...
- java.lang.Exception: Socket bind failed: [730048]
严重: Error initializing endpoint java.lang.Exception: Socket bind failed: [730048] ?????????×???(Э?é/ ...
- 使用路径arc-七彩
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> < ...
- OC 属性关键字
// 属性关键字 /* 1.ARC下(自动管理内存,自动引用计数)(IOS) strong,weak ----------------------------------------- 2.MRC下( ...
- python独角兽 Flask + Gunicorn
1.构建程序运行所需的虚拟环境 安装Miniconda 创建虚拟环境 添加程序运行依赖包 添加Gunicorn依赖 方式一:最简单的使用 easy_install 安装或者更新 方式二:下载源码安装 ...
- python里实现DSL
以后用到的话可以参考如下链接: http://safehammad.com/downloads/domain-specific-languages-and-python-2011-04-21.pdf ...
- Windows各种各种消息投递函数
1.SendMessage:发送消息给指定的窗口过程:直到窗口过程处理了消息才返回. 2.PostMessage:将消息放入消息队列(与指定窗口创建的线程相关)中:无需等待消息处理,立即返回. 不 ...