《DSP using MATLAB》Problem 5.7


代码:
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 5.7 \n\n'); banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ % --------------------------------------------------
% 1 x(n) = [ 2,4,6,1,3,5 ] N--period
% |
% --------------------------------------------------
x = [2, 4, 6, 1, 3, 5]; N = 6; n = [0 : N-1]; % periodic sequence with period N
y = x( mod(-n, N)+1 ); % circular fold figure('NumberTitle', 'off', 'Name', 'P5.7 x(n) and x(-n)')
set(gcf,'Color','white');
subplot(2,1,1); stem(n, x);
xlabel('n'); ylabel('x(n)');
title('$\tilde x(n) sequence, period N=6$', 'interpreter', 'latex', 'fontsize', 14); grid on;
subplot(2,1,2); stem(n, y);
xlabel('n'); ylabel('y(n)');
title('x(-n) sequence'); grid on; %% ------------------------------------------------------------------
%% DFS(k) of xn sequence, k=[0:N-1], N=6
%% ------------------------------------------------------------------
k1 = [0 : length(x)-1];
%k2 = [-N : N-1];
%k3 = [-N/2 : N/2];
Xk_1 = dfs(x, N); % DFS
magXk = abs( [ Xk_1 ] ); % DFS magnitude
angXk = angle( [Xk_1] )/pi; % DFS angle figure('NumberTitle', 'off', 'Name', 'P5.7 DFS(k) of x(n)')
set(gcf,'Color','white');
subplot(2,1,1); stem(k1, magXk); %axis([-N/2, N/2, -0.5, 50.5]);
xlabel('k'); ylabel('magnitude(k)');
title('DFS magnitude of x(n), N=6'); grid on;
subplot(2,1,2); stem(k1, angXk); %axis([-N/2, N/2, -0.5, 50.5]);
xlabel('k'); ylabel('angle(k)');
title('DFS angle of x(n), N=6'); grid on; %% ------------------------------------------------------------------
%% DFS(k) of yn sequence, k=[0:N-1], N=6
%% ------------------------------------------------------------------
k1 = [0 : length(y)-1];
%k2 = [-N : N-1];
%k3 = [-N/2 : N/2];
Yk_1 = dfs(y, N); % DFS
magYk = abs( [ Yk_1 ] ); % DFS magnitude
angYk = angle( [Yk_1] )/pi; % DFS angle figure('NumberTitle', 'off', 'Name', 'P5.7 DFS(k) of y(n)')
set(gcf,'Color','white');
subplot(2,1,1); stem(k1, magYk); %axis([-N/2, N/2, -0.5, 50.5]);
xlabel('k'); ylabel('magnitude(k)');
title('DFS magnitude of y(n), N=6'); grid on;
subplot(2,1,2); stem(k1, angYk); %axis([-N/2, N/2, -0.5, 50.5]);
xlabel('k'); ylabel('angle(k)');
title('DFS angle of y(n), N=6'); grid on;
运行结果:
周期序列及其圆周折叠序列:

原始序列的DFS系数

圆周折叠序列的DFS系数


《DSP using MATLAB》Problem 5.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窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ... 
随机推荐
- linux文件管理 文件权限
			文件权限介绍 [root@ssgao1987 ~]# ls -l 总用量 24 -rw-------. 1 root root 1161 7月 8 10:30 anaconda-ks.cfg - ... 
- Linux command stty
			Linux command stty reference: https://blog.csdn.net/lqxandroid2012/article/details/78929506 [Purpose ... 
- DoTween动画中的几种函数。
			1.transform.DOLocalMoveX(200, 1).From(true); 动画默认是从当前位置沿着X轴移动到x=200的位置. 加上Form变为从X=200的位置移动到当前位置,fro ... 
- python全栈开发笔记-----------概要
			Python开发 开发: 开发语言: 高级语言:python.Java.php .C# .Go .ruby . C++ .... ===>字节码 低级语言:C.汇编 ... 
- day044 cssy其他样式 js初识
			float: 浮动 .t1{ float: right/left; } 关于浮动的两个特点: 1.浮动的框可以向左或向右移动,知道他的外边缘碰到包括框或另一个浮动框的边框为止. 2.由于浮动框不在文档 ... 
- maven scope和项目发布需要注意的地方
			Maven Scope的使用: http://www.cnblogs.com/wangyonghao/p/5976055.html servlet-api和jsp-api等jar包,一般由servle ... 
- list的四种遍历方式
			1.手先增强for循环和iterator遍历的效果是一样的,也就说 增强for循环的内部也就是调用iteratoer实现的,但是增强for循环 有些缺点,例如不能在增强循环里动态的删除集合内容.不能获 ... 
- debian服务器解决中文安装后出现乱码的问题
			由于安装debian选择语言时选择了简体中文安装,但内核没有中文字库,导致某些字符显示为乱码(菱形,方块). 解决办法: 普通用户如果没有设置sudo权限,首先切换到root权限.然后: apt-ge ... 
- Cracking The Coding Interview 1.6
			//原文: // // Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, w ... 
- org.apache.httpcomponents httpclient 发起HTTP JSON请求
			1. pom.xml <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactI ... 
