代码:

%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% 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的更多相关文章

  1. 《DSP using MATLAB》Problem 5.22

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% O ...

  2. 《DSP using MATLAB》 Problem 3.22

    代码: %% ------------------------------------------------------------------------ %% Output Info about ...

  3. 《DSP using MATLAB》Problem 8.22

    时光飞逝,亲朋会一个一个离我们远去,孤独漂泊一阵子后,我们自己也要离开, 代码: %% -------------------------------------------------------- ...

  4. 《DSP using MATLAB》Problem 7.25

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  5. 《DSP using MATLAB》Problem 3.1

    先写DTFT子函数: function [X] = dtft(x, n, w) %% --------------------------------------------------------- ...

  6. 《DSP using MATLAB》Problem 7.29

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  7. 《DSP using MATLAB》Problem 7.27

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  8. 《DSP using MATLAB》Problem 7.26

    注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...

  9. 《DSP using MATLAB》Problem 7.24

    又到清明时节,…… 注意:带阻滤波器不能用第2类线性相位滤波器实现,我们采用第1类,长度为基数,选M=61 代码: %% +++++++++++++++++++++++++++++++++++++++ ...

随机推荐

  1. VS中常用快捷键

    常用的快捷键     这里仅列出一些个人觉得好用的快捷键: 调用智能提示:使用组合键“Ctrl+J” 注释/取消注释: 注释用组合键“Ctrl+K+C” 取消注释用组合键“Ctrl+K+U” 大小写转 ...

  2. Json使用示例

    使用Json,可以下载如下所示的6个Jar包 整个工程目录结构如下: 简单的用法: package json; import net.sf.json.JSONArray; import net.sf. ...

  3. Java实现随机生成车牌号

    String[] citys = {"津","京","宁"}; String sectionNamePre = "断面" ...

  4. [Leetcode221]最大面积 Maximal Square

    [题目] Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's a ...

  5. CentOS7安装cratedb

    crate: 下载: https://crate.io/download/thank-you/?download=tar crash: 下载: https://crate.io/docs/client ...

  6. java.lang.Runnable 源码分析

    子接口:RunnableFuture<V>, RunnableScheduledFuture<V> 实现类:AsyncBoxView.ChildState, ForkJoinW ...

  7. oracle 正则表达式 匹配

    oracle 正则表达式 在实际应用中,想排除带有中文的字段值: select h.froomnumber from t_broker_house h where REGEXP_LIKE(froomn ...

  8. <Codis><JedisPool><DeadLock>

    Overview Background: I start a thread [call thread A below]in Spark driver to handle opening files i ...

  9. TensorFlow函数:tf.ones_like

    tf.ones_like 函数 ones_like( tensor, dtype=None, name=None, optimize=True ) 定义在:tensorflow/python/ops/ ...

  10. 适用于WIFI Hacking的无线网卡推荐

    相信很多初次使用Kali Linux来进行无线渗透的小伙伴都曾遇到过一个非常头疼的问题,就是不知道如何选购一款合适的无线网卡.因为Kali Linux并不是所有的网卡都支持,一旦选错了网卡不仅会给我们 ...