一个复数序列可以分解为共轭偶对称和共轭奇对称部分。

代码:

%% ------------------------------------------------------------------------
%% 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的更多相关文章

  1. 《DSP using MATLAB》Problem 7.27

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  2. 《DSP using MATLAB》Problem 7.26

    注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...

  3. 《DSP using MATLAB》Problem 7.25

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  4. 《DSP using MATLAB》Problem 7.24

    又到清明时节,…… 注意:带阻滤波器不能用第2类线性相位滤波器实现,我们采用第1类,长度为基数,选M=61 代码: %% +++++++++++++++++++++++++++++++++++++++ ...

  5. 《DSP using MATLAB》Problem 7.23

    %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info a ...

  6. 《DSP using MATLAB》Problem 7.16

    使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  7. 《DSP using MATLAB》Problem 7.15

    用Kaiser窗方法设计一个台阶状滤波器. 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  8. 《DSP using MATLAB》Problem 7.14

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  9. 《DSP using MATLAB》Problem 7.13

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  10. 《DSP using MATLAB》Problem 7.12

    阻带衰减50dB,我们选Hamming窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

随机推荐

  1. Python -- Scrapy 命令行工具(command line tools)

    结合scrapy 官方文档,进行学习,并整理了部分自己学习实践的内容 Scrapy是通过 scrapy 命令行工具进行控制的. 这里我们称之为 “Scrapy tool” 以用来和子命令进行区分. 对 ...

  2. C# ref和out的本质

    ref和out参数的效果一样,都是通过关键字找到定义在主函数里面的变量的内存地址,并通过方法体内的语法改变它的大小.不同点就是输出参数必须对参数进行初始化.输出参数和引用参数的区别:从CLR的角度来看 ...

  3. protected 与 internal

    protected:在当前类的“内部”  和  派生子类的“内部” 可访问(注意:实例对象不可访问 或者说 访问不到):如果静态,则在当前类内部和派生子类内部  具有“全局效果” internal:在 ...

  4. Jon Snow and his Favourite Number CodeForces - 768C (技巧)

    链接 题意 给定数组, 每次操作先将数组排序, 再将奇数位全部异或x, 求k次操作后数组最大值与最小值 (1 ≤ n ≤ 105, 0 ≤ k ≤ 105, 0 ≤ x ≤ 103) 题解 直接暴力模 ...

  5. DZY Loves Colors CodeForces - 444C (线段树势能分析)

    大意:有$n$个格子, 初始$i$位置的颜色为$i$, 美丽值为0, 有两种操作 将区间$[l,r]$内的元素全部改为$x$, 每个元素的美丽值增加$|x-y|$, $y$为未改动时的值 询问区间$[ ...

  6. mac 安装phpunit

    大部分内容来自:https://blog.csdn.net/aishangyutian12/article/details/64124536 感谢创作,感谢分享 单元测试的重要性就不说了,postma ...

  7. php安装redis扩展全

    一.安装redis mac 下安装也可以使用 homebrew,homebrew 是 mac 的包管理器. 1.执行 brew install redis 2.启动 redis,可以使用后台服务启动  ...

  8. poj2686 状压dp入门

    状压dp第一题:很多东西没看懂,慢慢来,状压dp主要运用了位运算,二进制处理 集合{0,1,2,3,....,n-1}的子集可以用下面的方法编码成整数 像这样,一些集合运算就可以用如下的方法来操作: ...

  9. python-day59--前端 jQuery

    一.什么是jQuery?       http://jquery.cuishifeng.cn/ 类似Python里面的模块 是js的一个库/插件/工具 二.JS和jQuery的关系 - jQuery就 ...

  10. Eclipse SVN 合并分支/主干

    可以从主干合并到分支,也可以从分支合并到主干,根据需要可以选择合适的选项,如下图: