《DSP using MATLAB》Problem 6.22
代码:
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 6.22 \n\n'); banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%format long;
format short; fprintf('\n FIR filter DIRECT-form: \n');
h = [1, -4, 6.4, -5.12, 2.048, -0.32768]; b = h
a = 1.0 fprintf('\nConvert DIRECT-form to PARALLEL-form : \n');
[C, Bp, Ap] = dir2par(b, a) if size(C)==0
C = 0;
end fprintf('\nConvert DIRECT-form to CASCADE-form : \n');
[b0, Bc, Ac] = dir2cas(b, a) fprintf('\nConvert TF-form to SOS-form : \n');
[sos, g] = tf2sos(b, a) fprintf('\nConvert DIRECT-form to FREQUENCY-SAMPLE-form 1 : \n');
[Cfs, Bfs, Afs] = dir2fs(b) fprintf('\nConvert DIRECT-form to FREQUENCY-SAMPLE-form 2 : \n');
r = 0.99;
[Cfs_r, Bfs_r, Afs_r, rM] = dir2fs_r(b, r) % ----------------------------------------------------------
% NOTE: linear-phase can not use LATTICE-form
% ----------------------------------------------------------
fprintf('\nConvert DIRECT-form to All-Zero LATTICE-form : \n');
[Klc] = dir2latc(b) % -----------------------------------------
% START check
% -----------------------------------------
n = [0:7];
delta = impseq(0, 0, 7)
%format long
format short
hcas = casfiltr(b0, Bc, Ac, delta) hltc = latcfilt(Klc, delta) %hladr = ladrfilt(Klr, Clr, delta) hdir = filter(b, a, delta)
% -------------------------------------------
% END check
% ------------------------------------------- % +++++++++++++++++++++++++++++++++++++++++++++++++
% 5 1st-order section CASCADE-form
% +++++++++++++++++++++++++++++++++++++++++++++++++
broots = roots(b)
L = length(broots)
B1 = ones(L, 2); fprintf('\nConvert DIRECT-form to %d 1st-order section : \n', L);
for i = 1:1:L
B1(i,:) = poly( broots(i) );
end
B1 % +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
% CASCADE-form of 1 1st-order section and 2 2nd-order section
% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
fprintf('\nConvert DIRECT-form to One 1st-order and Two 2nd-order section: \n');
B2 = poly( [broots(1), broots(2)] )
B3 = poly( [broots(3), broots(4)] )
B4 = poly( broots(5) ) % +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
% CASCADE-form of 1 2nd-order section and 1 3rd-order section
% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
fprintf('\nConvert DIRECT-form to One 2nd-order and One 3rd-order section: \n');
B5 = poly( [broots(1), broots(2)] )
B6 = poly( [broots(3), broots(4), broots(5)] )
运行结果:
直接形式的系数
串联形式系数
频率采样形式系数
格型Lattice形式系数
求出5个零点
《DSP using MATLAB》Problem 6.22的更多相关文章
- 《DSP using MATLAB》Problem 5.22
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% O ...
- 《DSP using MATLAB》 Problem 3.22
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》Problem 8.22
时光飞逝,亲朋会一个一个离我们远去,孤独漂泊一阵子后,我们自己也要离开, 代码: %% -------------------------------------------------------- ...
- 《DSP using MATLAB》Problem 7.25
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 3.1
先写DTFT子函数: function [X] = dtft(x, n, w) %% --------------------------------------------------------- ...
- 《DSP using MATLAB》Problem 7.29
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.27
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.26
注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.24
又到清明时节,…… 注意:带阻滤波器不能用第2类线性相位滤波器实现,我们采用第1类,长度为基数,选M=61 代码: %% +++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- loaclStorage、sessionStorage
这里需要注意的是这两种储存方式只能以字符串的形式来存取 html5中的Web Storage包括了两种存储方式:sessionStorage和localStorage.sessionStorage用于 ...
- js两种打开新窗口
1.超链接<a href="http://www.jb51.net" title="脚本之家">Welcome</a> 等效于js代码 ...
- 【阅读笔记】《C程序员 从校园到职场》第五章 内存操作
参考: 让你提前认识软件开发(8):memset()与memcpy()函数 https://blog.csdn.net/zhouzxi/article/details/22478081 让你提前 ...
- day36 数据库表操作 数据类型 完整性约束
今日内容 1.存储引擎表类型 2.数据类型 3.完整性约束 1.存储引擎表类型 指令: 1.show engines:#查看MySQL所有的引擎, 2.show variables like &quo ...
- python操作Excel读写(使用xlrd和xlrt)
包下载地址:https://pypi.python.org/pypi/xlrd 导入 import xlrd 打开excel data = xlrd.open_workbook('demo.xls ...
- [Leetcode 44]通配符匹配Wildcard Matching
[题目] 匹配通配符*,?,DP动态规划,重点是*的两种情况 想象成两个S.P长度的字符串,P匹配S. S中不会出现通配符. [条件] (1)P=null,S=null,TRUE (2)P=null, ...
- js 变量的声明能提升 初始化不会提升
var x = 5; // 初始化 x elem = document.getElementById("demo"); // 查找元素 elem.innerHTML = x + & ...
- java基础学习之抽象类
以下内容是自己学习后的一个备忘笔记,理解上肯定有很多问题,望有耐心的大神能给予指点,谢谢 定义:抽象是对事物的一个模糊定义,它主要对那些有共性功能但具体实现不同的对象进行抽象,提高代码的复用性和简洁性 ...
- react 学习笔记 npm 命令
第一步: cnpm install --save react react-dom babelify babel-preset-react 第二步: 安装es2015 cnpm install babe ...
- 利用python实现电影推荐
"协同过滤"是推荐系统中的常用技术,按照分析维度的不同可实现"基于用户"和"基于产品"的推荐. 以下是利用python实现电影推荐的具体方法 ...