昨晚手机在看X信的时候突然黑屏,开机重启都没反应,今天维修师傅说使用时间太长了,还是买个新的吧,心疼银子啊!

这里只放前两个小题的图。

代码:

1、

%% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 5.28 \n\n'); banner();
%% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ % -------------------------------------------------------------------
% Computer N-point Circular Convolution
% -------------------------------------------------------------------
n1 = [0:5];
x1 = sin(pi*n1/3);
N1 = length(x1); n2 = [0:7];
x2 = cos(pi*n2/4);
N2 = length(x2); % --------------------------------------------
% 1st way TIME domain
% --------------------------------------------
N = 10;
n = [0:N-1]; y1 = circonvt(x1, x2, N); % --------------------------------------------
% 2nd way ---- circular conv(FREQ domain)
% --------------------------------------------
y2 = circonvf(x1, x2, N); % --------------------------------------------
% 3rd way --- Cir Conv (Circulant Matrix)
% --------------------------------------------
y3 = circonvt_v3(x1, x2, N); figure('NumberTitle', 'off', 'Name', 'P5.28.1 x1(n) and x2(n)')
set(gcf,'Color','white');
subplot(2,1,1); stem(n1, x1);
xlabel('n'); ylabel('x1(n)');
title('x1(n), N=6'); grid on;
subplot(2,1,2); stem(n2, x2);
%axis([-N/2, N/2, -0.5, 50.5]);
xlabel('n'); ylabel('x2(n)');
title('x2(n), N=8'); grid on; figure('NumberTitle', 'off', 'Name', 'P5.28.1 Cir-Conv, N=10')
set(gcf,'Color','white');
subplot(3,1,1); stem(n, y1);
xlabel('n'); ylabel('y1(n)');
title('Time Domain, y1(n)'); grid on;
subplot(3,1,2); stem(n, y2);
%axis([-N/2, N/2, -0.5, 50.5]);
xlabel('n'); ylabel('y2(n)');
title('FREQ domain, y2(n)'); grid on;
subplot(3,1,3); stem(n, y3);
%axis([-N/2, N/2, -0.5, 50.5]);
xlabel('n'); ylabel('y3(n)');
title('Circulant Matrix, y3(n)'); grid on;

  运行结果:

计算圆周卷积的两序列

三种方法计算圆周卷积

2、

代码:

%% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 5.28 \n\n'); banner();
%% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ % -------------------------------------------------------------------
% Computer N-point Circular Convolution
% -------------------------------------------------------------------
N = 32;
n1 = [0:N-1];
x1 = cos(2*pi*n1/N);
N1 = length(x1); n2 = [0:N-1];
x2 = sin(2*pi*n2/N);
N2 = length(x2); % --------------------------------------------
% 1st way TIME domain
% --------------------------------------------
%N = 10;
n = [0:N-1]; y1 = circonvt(x1, x2, N); % --------------------------------------------
% 2nd way ---- circular conv(FREQ domain)
% --------------------------------------------
y2 = circonvf(x1, x2, N); % --------------------------------------------
% 3rd way --- Cir Conv (Circulant Matrix)
% --------------------------------------------
y3 = circonvt_v3(x1, x2, N); figure('NumberTitle', 'off', 'Name', 'P5.28.2 x1(n) and x2(n)')
set(gcf,'Color','white');
subplot(2,1,1); stem(n1, x1);
xlabel('n'); ylabel('x1(n)');
title('x1(n)=cos(2*pi*n1/N), N=32'); grid on;
subplot(2,1,2); stem(n2, x2);
%axis([-N/2, N/2, -0.5, 50.5]);
xlabel('n'); ylabel('x2(n)');
title('x2(n)=sin(2*pi*n2/N), N=32'); grid on; figure('NumberTitle', 'off', 'Name', 'P5.28.2 Cir-Conv, N=32')
set(gcf,'Color','white');
subplot(3,1,1); stem(n, y1);
xlabel('n'); ylabel('y1(n)');
title('Time Domain, y1(n)'); grid on;
subplot(3,1,2); stem(n, y2);
%axis([-N/2, N/2, -0.5, 50.5]);
xlabel('n'); ylabel('y2(n)');
title('FREQ domain, y2(n)'); grid on;
subplot(3,1,3); stem(n, y3);
%axis([-N/2, N/2, -0.5, 50.5]);
xlabel('n'); ylabel('y3(n)');
title('Circulant Matrix, y3(n)'); grid on;

  运行结果:

代码结构都一样

圆周卷积结果

最新文章

  1. JQuery知识快览之二—事件
  2. Internet Explorer已限制此网页运行可以访问计算机的脚本或ActiveX控件
  3. 构建之法&lt;第四章&gt;之感悟
  4. 记录一些容易忘记的属性 -- UIView
  5. OperationResult
  6. HDU 1142 A Walk Through the Forest (记忆化搜索 最短路)
  7. SPRING IN ACTION 第4版笔记-第八章Advanced Spring MVC-004-Pizza例子的用户流程(flowExecutionKey、_eventId_phoneEntered、flowExecutionUrl )
  8. WordPress Complete Gallery Manager插件‘upload-images.php’任意文件上传漏洞
  9. 京东金融集团BD部门招聘 BD经理
  10. 查看linux信息
  11. wamp的安装--亲测有用
  12. 7.28.1 Spring构造注入还是设置注入
  13. JAVA 调用 R 语言
  14. vue的学习之路
  15. 【LOJ#6074】子序列(动态规划)
  16. .Net调用Java带验证的WebService解决方法
  17. Game Physics Cookbook (Gabor Szauer 著)
  18. 二叉树的遍历--C#程序举例二叉树的遍历
  19. 用过的sql 工具
  20. [DeeplearningAI笔记]序列模型3.3集束搜索

热门文章

  1. Win10系列:VC++绘制位图图片
  2. AdminLTE 文档
  3. java⑦
  4. 当你有双网络(内部网+互联网)时,如何透明NAT给其他电脑上网。虚拟机+爱快
  5. sql语句最后一行显示统计。
  6. Java并发编程_volatile关键字的用法(二)
  7. 重写equals() 和 hashCode()方法
  8. CentOS7安装配置Amanda
  9. linux 清空文件
  10. spring源码研究1 如何导入源码