《DSP using MATLAB》Problem 6.6


代码:
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% 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的更多相关文章
- 《DSP using MATLAB》Problem 7.27
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.26
注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.25
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.24
又到清明时节,…… 注意:带阻滤波器不能用第2类线性相位滤波器实现,我们采用第1类,长度为基数,选M=61 代码: %% +++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.23
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info a ...
- 《DSP using MATLAB》Problem 7.16
使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.15
用Kaiser窗方法设计一个台阶状滤波器. 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.14
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.13
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.12
阻带衰减50dB,我们选Hamming窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- inode占用100%时硬盘无法写入文件故障处理
故障现象: 分区无法写入文件. 故障分析: 执行df -h命令发现空间占用不到50%,执行df -hi,发现某分区IUse%值为99%,说明innode已经用完,应该是某些目录下存在大量的小文件导致. ...
- tomcat 服务器线程问题
http://blog.csdn.net/wtopps/article/details/71339295 http://blog.csdn.net/wtopps/article/details/713 ...
- Oracle与MySQL的SQL语句区别
2 表 2.1 创建表(同) create table tableName( columnName1 int, columnName2 int ) 2.2 删除表(异) MySQL: drop tab ...
- 准备下上机考试,各种排序!!以后再添加和仿真像wiki上那样!
#include <stdio.h> #include <string.h> #define N 6 typedef struct { ]; int score; }stude ...
- bootstarp3
1.布局 样式 col-**-1 最大为col-lg-12 表示最大 2.下拉框 .dropdown 下拉菜单(Dropdown)插件 https://github.com/danielf ...
- jquery 将一组元素转换成数组
HTML 代码: <p><b>Values: </b></p> <form> <input type="text" ...
- gmtdefaults locate
http://seisman.blog.ustc.edu.cn/index.php/archives/553
- SharePoint REST API - 基本操作(二)
博客地址:http://blog.csdn.net/FoxDave 上一节讲了SharePoint REST API的一些基本操作,本节将继续介绍一些关于SharePoint REST API的内容. ...
- mysql encode decode加密和解密
加密:模板:insert into user(userpass) values(encode('useerpass','str')) insert into user(userid,username, ...
- 小波学习之一(单层一维离散小波变换DWT的Mallat算法C++和MATLAB实现) ---转载
1 Mallat算法 离散序列的Mallat算法分解公式如下: 其中,H(n).G(n)分别表示所选取的小波函数对应的低通和高通滤波器的抽头系数序列. 从Mallat算法的分解原理可知,分解后的序 ...