《DSP using MATLAB》示例Example 6.26

代码:
%
r = 0.9; theta = (pi/180)*[-55:5:-35, 35:5:55]';
p = r*exp(j*theta); a = poly(p); b = 1; % Direct form: quantized coefficients
N = 15; [ahat, L, B] = QCoeff(a, N);
TITLE = sprintf('%i-bit (1+%i+%i) Precision', N+1, L, B); % Comparison of Pole-Zero Plots
figure('NumberTitle', 'off', 'Name', 'Exameple 6.26a')
set(gcf,'Color','white'); subplot(1, 2, 1); [HZ, HP, Hl] = zplane(1, a);
set(HZ, 'color', 'g', 'linewidth', 1);
set(HP, 'color', 'g', 'linewidth', 1);
set(Hl, 'color', 'b'); axis([-1.1, 1.1, -1.1, 1.1]); grid on;
title('Infinite Precision', 'fontsize', 10, 'fontweight', 'bold'); subplot(1, 2, 2); [HZhat, HPhat, Hlhat] = zplane(1, ahat);
set(HZhat, 'color', 'r', 'linewidth', 1);
set(HPhat, 'color', 'r', 'linewidth', 1);
set(Hlhat, 'color', 'b'); axis([-1.1, 1.1, -1.1, 1.1]); grid on;
title(TITLE, 'fontsize', 10, 'fontweight', 'bold'); % Cascade form: quantized coefficients: Same N
[b0, B0, A0] = dir2cas(b, a); [BAhat1, L1, B1] = QCoeff([B0, A0], N);
TITLE1 = sprintf('%i-bit (1+%i+%i) Precision', N+1, L1, B1);
Bhat1 = BAhat1(:, 1:3); Ahat1 = BAhat1(:, 4:6);
[bhat1, ahat1] = cas2dir(b0, Bhat1, Ahat1); figure('NumberTitle', 'off', 'Name', 'Exameple 6.26b')
set(gcf,'Color','white'); subplot(1, 2, 1); [HZhat1, HPhat1, Hlhat1] = zplane(bhat1, ahat1);
set(HZhat1, 'color', 'g', 'linewidth', 1);
set(HPhat1, 'color', 'g', 'linewidth', 1);
set(Hlhat1, 'color', 'b'); axis([-1.1, 1.1, -1.1, 1.1]); grid on;
title(TITLE1, 'fontsize', 10, 'fontweight', 'bold'); % Cascade fomr: quantized coefficients: Same B (N=L1+B)
N1 = L1 + B; [BAhat2, L2, B2] = QCoeff([B0, A0], N1);
TITLE2 = sprintf('%i-bit (1+%i+%i) Precision', N1+1, L2, B2);
Bhat2 = BAhat2(:, 1:3); Ahat2 = BAhat2(:, 4:6);
[bhat2, ahat2] = cas2dir(b0, Bhat2, Ahat2); subplot(1, 2, 2); [HZhat2, HPhat2, Hlhat2] = zplane(bhat2, ahat2);
set(HZhat2, 'color', 'r', 'linewidth', 1);
set(HPhat2, 'color', 'r', 'linewidth', 1);
set(Hlhat2, 'color', 'b'); axis([-1.1, 1.1, -1.1, 1.1]); grid on;
title(TITLE2, 'fontsize', 10, 'fontweight', 'bold');
结果:


《DSP using MATLAB》示例Example 6.26的更多相关文章
- 《DSP using MATLAB》Problem 7.26
注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 8.26
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- DSP using MATLAB 示例Example3.21
代码: % Discrete-time Signal x1(n) % Ts = 0.0002; n = -25:1:25; nTs = n*Ts; Fs = 1/Ts; x = exp(-1000*a ...
- DSP using MATLAB 示例 Example3.19
代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Discrete-time Signa ...
- DSP using MATLAB示例Example3.18
代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Continuous-time Fou ...
- DSP using MATLAB 示例Example3.23
代码: % Discrete-time Signal x1(n) : Ts = 0.0002 Ts = 0.0002; n = -25:1:25; nTs = n*Ts; x1 = exp(-1000 ...
- DSP using MATLAB 示例Example3.22
代码: % Discrete-time Signal x2(n) Ts = 0.001; n = -5:1:5; nTs = n*Ts; Fs = 1/Ts; x = exp(-1000*abs(nT ...
- DSP using MATLAB 示例Example3.17
- DSP using MATLAB示例Example3.16
代码: b = [0.0181, 0.0543, 0.0543, 0.0181]; % filter coefficient array b a = [1.0000, -1.7600, 1.1829, ...
- DSP using MATLAB 示例 Example3.15
上代码: subplot(1,1,1); b = 1; a = [1, -0.8]; n = [0:100]; x = cos(0.05*pi*n); y = filter(b,a,x); figur ...
随机推荐
- scp 上传 下载 文件
linux 中的ssh命令: scp 可以用来上传本地文件到远程服务器 或下载远程服务器中的文件到本地 1. 上传本地文件到远程服务器 scp readme.md user@www.*****.com ...
- php特级课---4、网站服务监控
php特级课---4.网站服务监控 一.总结 一句话总结:这些是架构师的知识 网络流量监控:cacti,mrtg 邮件报警系统:postfix 压力测试工具:Apache压力测试软件-ab,Mysql ...
- 应用性能管理工具PinPoint介绍
概述: 下面介绍一个开源的 APM (Application Performance Management/应用性能管理)工具 - Pinpoint.一个分布式事务跟踪系统的平台,思路基于google ...
- Putty实现Linux与Windows互传文件
putty远程连接VPS,先开一贴,有空来整理. 从putty官网下载putty,选择[A Windows installer for everything except PuTTYtel]安装包,下 ...
- Django 中设置分页页码,只显示当前页以及左右两页
设置后的效果如下: Django 给我们提供了分页的功能:`Paginator`和`Page`类都是用来做分页的.他们在Django中的路径为:`from django.core.paginator ...
- LeetCode OJ:Search in Rotated Sorted Array II(翻转排序数组的查找)
Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed? Would this ...
- CSS3径向渐变linear-gradient
语法: 选择器{ background:linear-gradien(线性渐变的方向,起点颜色,终点颜色): } 第一个参数:[可选参数,默认从上到下] 线性渐变的方向:top,bottom,left ...
- three.js入门——先跑个旋转的正方体
WebGl中文网看了几篇教程,又百度了几篇文章,顿时感觉手痒,打开编辑器,写个demo玩玩. demo是写在vue项目中的,所以首先: npm install three --save; npm in ...
- 一段处理json的C#代码
服务器端: using Newtonsoft.Json; using Newtonsoft.Json.Linq; public ActionResult GetGatherData() { IList ...
- objc/runtime.h 相关
Objecitve-C的重要特性是Runtime(运行时),在Interacting with the Runtime(交互运行)中,运行时函数部分,苹果给出了/usr/lib/libobjc.A.d ...