代码:

%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 6.6 \n\n'); banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ hb = [1 cos(0.1*pi) cos(0.2*pi) cos(0.3*pi) cos(0.4*pi)]; % numerator polynominal
ha = [1 0.8*sin(0.1*pi) (0.8^2)*sin(0.2*pi) (0.8^3)*sin(0.3*pi) (0.8^4)*sin(0.4*pi) (0.8^5)*sin(0.5*pi)]; xb = 1;
xa = [1 0 -1]; fprintf('\n FIR filter DIRECT-form: \n');
b = hb
a = conv(ha, xa)
%a = ha; fprintf('\nConvert DIRECT-form to CASCADE-form : \n');
[b0, Bc, Ac] = dir2cas(b, a) fprintf('\nConvert DIRECT-form to PARALLEL-form : \n');
[C, Bp, Ap] = dir2par(b, a)
C = 0; fprintf('\nConvert DIRECT-form to LATTICE-LADDER-form : \n');
[Klr, Clr] = dir2ladr(b, a) fprintf('\nConvert DIRECT-form to MATLAB LATTICE-LADDER-form : \n');
[K, V] = tf2latc(b, a) % -----------------------------------------
% START check
% -----------------------------------------
n = [0:7];
delta = impseq(0, 0, 7)
%format long
format short
hcas = casfiltr(b0, Bc, Ac, delta) hpar = parfiltr(C, Bp, Ap, delta) hladr = ladrfilt(Klr, Clr, delta) hdir = filter(b, a, delta)
% -------------------------------------------
% END check
% ------------------------------------------- figure('NumberTitle', 'off', 'Name', 'P6.6 hcas(n), hpar(n)')
set(gcf,'Color','white');
subplot(2,1,1); stem(n, hcas);
xlabel('n'); ylabel('hcas(n)');
title('hcas(n)'); grid on;
subplot(2,1,2); stem(n, hpar);
xlabel('n'); ylabel('hpar(n)');
title('hpar(n)'); grid on; figure('NumberTitle', 'off', 'Name', 'P6.6 hladr(n) hdir(n)')
set(gcf,'Color','white');
subplot(2,1,1); stem(n, hladr);
xlabel('n'); ylabel('hladr(n)');
title('hladr(n)'); grid on;
subplot(2,1,2); stem(n, hdir);
xlabel('n'); ylabel('hdir(n)');
title('hdir(n)'); grid on;

  运行结果:

直接形式系数

串联形式系数

并联形式系数

格型系数

《DSP using MATLAB》Problem 6.6的更多相关文章

  1. 《DSP using MATLAB》Problem 7.27

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

  2. 《DSP using MATLAB》Problem 7.26

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

  3. 《DSP using MATLAB》Problem 7.25

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

  4. 《DSP using MATLAB》Problem 7.24

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

  5. 《DSP using MATLAB》Problem 7.23

    %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info a ...

  6. 《DSP using MATLAB》Problem 7.16

    使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  7. 《DSP using MATLAB》Problem 7.15

    用Kaiser窗方法设计一个台阶状滤波器. 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  8. 《DSP using MATLAB》Problem 7.14

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

  9. 《DSP using MATLAB》Problem 7.13

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

  10. 《DSP using MATLAB》Problem 7.12

    阻带衰减50dB,我们选Hamming窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

随机推荐

  1. ROM、PROM、EPROM、EEPROM、FLASH ROM、FLASH、eMMC

    ROM(Read Only Memory,只读存储器)芯片:在微机的发展初期,BIOS都存放在ROM芯片中.ROM内部的资料是在ROM的制造工序中,在工厂里用特殊的方法被烧录进去的,其中的内容只能读不 ...

  2. bzoj1010

    题解: 斜率优化dp f[i]=f[j]+(i-j+sum[i]-sum[j]-L)^2 然后斜率优化 代码: #include<bits/stdc++.h> typedef long l ...

  3. what’s this?

    jdk,jre,jvm三者区别:JDK: (Java Development ToolKit) java开发工具包.JDK是整个java的核心! 包括了java运行环境 JRE(Java Runtim ...

  4. Hibernate基础知识

    Hibernate Hibernate的作用: 1.         Hibernate解决ORM(对象关系映射)的问题,大大减少了持久层的代码量 2.         hql方言,解决了可移植性问题 ...

  5. day037 行记录的操作

    1.库操作 2.表操作 3.行操作 1.库操作 1)创建数据库 语法: create database 数据库名 charset utf8; 数据库命名规则: 由数字,字母,下划线,@,#,$ 等组成 ...

  6. sas 变量类型转换

    data b2: set b1; newbl=put(oldbl,10.); run; 根据转换后的类型灵活填写

  7. PLY文件格式

    一.PLY简介 PLY文件格式是Stanford大学开发的一套三维mesh模型数据格式,图形学领域内很多著名的模型数据,比如Stanford的三维扫描数据库(其中包括很多文章中会见到的Happy Bu ...

  8. Cracking The Coding Interview 1.7

    //Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set ...

  9. tp配置

    <?php// +----------------------------------------------------------------------// | ThinkPHP [ WE ...

  10. matlab中的reshape快速理解,卷积和乘积之间的转换

    reshape: THe convertion between convolution and multiplication: