《DSP using MATLAB》Problem 5.12
1、从别的地方找的证明过程:
2、代码
function x2 = circfold(x1, N)
%% Circular folding using DFT
%% ---------------------------------------------
%% x2 = circfold(x1, N)
%% x2 = circulary folded output sequence
%% x1 = input sequence of length <= N
%% N = circular buffer length
%% X1k_DFT = dft(x1, N);
Xk = dft(X1k_DFT, N);
x2 = Xk/N;
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 5.12 \n\n'); banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ % --------------------------------------------------------------
% 1 x(n) = [1, 3, 5, 7, 9, -7, -5, -3, -1]
% -------------------------------------------------------------- xx1 = [1, 3, 5, 7, 9, -7, -5, -3, -1];
NN1 = length(xx1); % length is 6
nn1 = [0 : NN1-1]; % ----------------------------------------------------
% 1st way to get Circulary folded
% ----------------------------------------------------
xx1_cf = xx1( mod(-nn1, NN1)+1 ); figure('NumberTitle', 'off', 'Name', 'P5.12 x(n)')
set(gcf,'Color','white');
subplot(2,1,1); stem(nn1, xx1);
xlabel('n'); ylabel('x(n)');
title('x(n) ori sequence'); grid on;
subplot(2,1,2); stem(nn1, xx1_cf);
xlabel('n'); ylabel('x(n)');
title('x((-n))_N Circulary folded by mod way'); grid on; % ------------------------------------------------------
% 2nd way to get Circulary folded
% DFT
% ------------------------------------------------------ xx2 = circfold(xx1, NN1); figure('NumberTitle', 'off', 'Name', 'P5.12 x(n)')
set(gcf,'Color','white');
subplot(2,1,1); stem(nn1, xx1);
xlabel('n'); ylabel('x(n)');
title('x(n) ori sequence'); grid on;
subplot(2,1,2); stem(nn1, xx2);
xlabel('n'); ylabel('x(n)');
title('x((-n))_N Circulary folded by DFT way'); grid on;
运行结果:
《DSP using MATLAB》Problem 5.12的更多相关文章
- 《DSP using MATLAB》Problem 7.12
阻带衰减50dB,我们选Hamming窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 6.12
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 8.12
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》Problem 4.12
代码: function [As, Ac, r, v0] = invCCPP(b0, b1, a1, a2) % Determine the signal parameters Ac, As, r, ...
- 《DSP using MATLAB》Problem 3.12
- 《DSP using MATLAB》Problem 7.6
代码: 子函数ampl_res function [Hr,w,P,L] = ampl_res(h); % % function [Hr,w,P,L] = Ampl_res(h) % Computes ...
- 《DSP using MATLAB》Problem 6.22
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 6.8
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 5.21
证明: 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- spring boot 打jar包
想必大家经常会出现以下报错信息 java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Fai ...
- printf以%d形式输出浮点数的问题
若运行时从键盘上输入9876543210l,则下面程序的输出结果是 int main(){ int a;float b,c; scanf("%2d%3f%4f",&a,&a ...
- DoTween动画中的几种函数。
1.transform.DOLocalMoveX(200, 1).From(true); 动画默认是从当前位置沿着X轴移动到x=200的位置. 加上Form变为从X=200的位置移动到当前位置,fro ...
- javascript进阶笔记(2)
js是一门函数式语言,因为js的强大威力依赖于是否将其作为函数式语言进行使用.在js中,我们通常要大量使用函数式编程风格.函数式编程专注于:少而精.通常无副作用.将函数作为程序代码的基础构件块. 在函 ...
- PHP和Mysql事物处理
这几天做支付的时候,又用到了事物,为了方便自己以后查看,今天闲的没事就把以前的东西整理下.(其中引用别人的东西,在这里谢谢他们贡献的代码!) 一.事务处理概述: 事务:是若干事件的集合 事务处理:当所 ...
- [Leetcode221]最大面积 Maximal Square
[题目] Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's a ...
- SpringMVC配置及使用
SpringMVC基本配置 SpringMVC是基本请求响应模式的框架. 在项目中集成SpringMVC框架首先需要导入相关的jar包,所需包具体如下: commons-dbcp.jar common ...
- 循环神经网络-LSTM进阶
基础的LSTM模型,单隐层,隐层单神经元,而实际中一般需要更为复杂的网络结构, 下面借用手写数字的经典案例构造比较复杂的LSTM模型,并用代码实现. 单隐层,隐层多神经元 # -*- coding:u ...
- get 和post 请求的写法
get请求 import requests base_url = 'http://httpbin.org' # 定义请求所需的参数,参数之间以英文逗号隔开 param_data = {'} # 发送G ...
- synchronized(八)
package com.bjsxt.base.sync006;/** * 同一对象属性的修改不会影响锁的情况 * @author alienware * */public class ModifyLo ...