《DSP using MATLAB》Problem 5.35
余弦序列的谱,原始频率w0会泄露到其它频率处。
从其它书中找到的证明过程:
代码:
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 5.35 \n\n'); banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ % -------------------------------------------------------------------------------------
% X(k) is DFTs of real-valued sequence x(n)
% x(n)=A*cos(wn)R(n) n=[0:N-1]
%
% x(n) = cos(5*pi*n/99) n=[0:200-1]
% -------------------------------------------------------------------------------------
N = 200; A = 1;
n1 = [0:N-1];
x1 = A*cos(5*pi*n1/99); figure('NumberTitle', 'off', 'Name', 'P5.35 x(n), N=200')
set(gcf,'Color','white');
stem(n1, x1);
xlabel('n'); ylabel('x(n)');
title('x(n)=cos(5\pin/99)'); grid on; k1 = [0:N-1];
Xk_DFT = fft(x1, N);
N1 = length(Xk_DFT); % length magXk_DFT = abs( [ Xk_DFT ] ); % DFT magnitude
angXk_DFT = angle( [Xk_DFT] )/pi; % DFT angle
realXk_DFT = real(Xk_DFT); imagXk_DFT = imag(Xk_DFT); figure('NumberTitle', 'off', 'Name', 'P5.35 X(k), N=200')
set(gcf,'Color','white');
subplot(2,1,1); stem(k1, realXk_DFT);
xlabel('k'); ylabel('real (k)');
title('real DFT of x(n)'); grid on;
subplot(2,1,2); stem(k1, imagXk_DFT);
%axis([-N/2, N/2, -0.5, 50.5]);
xlabel('k'); ylabel('imag (k)');
title('imag DFT of x(n)'); grid on;
运行结果:
《DSP using MATLAB》Problem 5.35的更多相关文章
- 《DSP using MATLAB》Problem 8.35
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》Problem 7.35
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.27
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.23
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info a ...
- 《DSP using MATLAB》Problem 7.14
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.13
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.11
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.10
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.9
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
随机推荐
- Python Django 之 基于JQUERY的AJAX 登录页面
一.基于Jquery的Ajax的实现 1.url 2.vews 3.templates
- maven scope和项目发布需要注意的地方
Maven Scope的使用: http://www.cnblogs.com/wangyonghao/p/5976055.html servlet-api和jsp-api等jar包,一般由servle ...
- tfs 2017 使用
安装完成之后,创建一个项目管理. 初始化代码库 然后下载代理 (服务器)并设置.下载代理需要FQ才可以下载成功. 想要支持 netcore2.0 必须在代理服务器上安装 vs2017 跟netcor ...
- linux 创建安装redis服务
1.找下redis的官方的下载地址:http://download.redis.io/releases/redis-3.2.8.tar.gz 有最新的就下载最新 先下载解压跟安装 wget http ...
- linux系统安装mysql详细配置
参考文章https://baijiahao.baidu.com/s?id=1584072431498789934&wfr=spider&for=pc https://www.5yun. ...
- java Dom4j xml 写
手动拼接xml 并返回 依赖包 <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</ ...
- 2017 秦皇岛CCPC Balloon Robot (ZOJ 3981)
题意:给出n个队伍,m个座位,q次A题的队伍与时间,下一行是n个队伍的坐的位置,再下面q行就是第x个队再第y秒A出一道题,然后有一个机器人,开始位置由你选,他每走一步 他就会向右走一格,走到m的时候会 ...
- ubantu 常用命令
1.显示日期与时间的命令:date 2.显示日历的命令:cal 3.简单好用的计算器:bc 4.热键“命令补全或文件补齐”:Tab 5.热键“中断目前程序”:Ctrl+C 6.热键“键盘输入结束(En ...
- log4j下载地址及日志文件输入位置配置
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the clas ...
- MAC机下用Terminal操作MySql
在MAC机上安装好MySql后,在Terminal内运行mysql时会提示mysql command not found命令.这是因为没有把运行时的路径添加到$PATH变量中.检查$PATH变量中是否 ...