《DSP using MATLAB》示例Example 8.27
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Exameple 8.27 \n\n'); time_stamp = datestr(now, 31);
[wkd1, wkd2] = weekday(today, 'long');
fprintf(' Now is %20s, and it is %8s \n\n', time_stamp, wkd2);
%% ------------------------------------------------------------------------ % Digital Highpass Filter Specifications:
wp = 0.6*pi; % digital passband freq in rad
ws = 0.4586*pi; % digital stopband freq in rad
Rp = 1; % passband ripple in dB
As = 15; % stopband attenuation in dB [bhp, ahp] = cheb1hpf(wp, ws, Rp, As); [C, B, A] = dir2cas(bhp, ahp) % Calculation of Frequency Response:
%[dblp, maglp, phalp, grdlp, wwlp] = freqz_m(blp, alp);
[dbhp, maghp, phahp, grdhp, wwhp] = freqz_m(bhp, ahp); %% -----------------------------------------------------------------
%% Plot
%% ----------------------------------------------------------------- figure('NumberTitle', 'off', 'Name', 'Exameple 8.27')
set(gcf,'Color','white');
M = 1; % Omega max subplot(2,2,1); plot(wwhp/pi, maghp); axis([0, M, 0, 1.2]); grid on;
xlabel(' frequency in \pi units'); ylabel('|H|'); title('Highpass Filter Magnitude Response');
set(gca, 'XTickMode', 'manual', 'XTick', [0, 0.4586, 0.6, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [0, 0.8913, 1]); subplot(2,2,2); plot(wwhp/pi, dbhp); axis([0, M, -30, 2]); grid on;
xlabel(' frequency in \pi units'); ylabel('Decibels'); title('Highpass Filter Magnitude in dB');
set(gca, 'XTickMode', 'manual', 'XTick', [0, 0.4586, 0.6, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [-30, -15, -1, 0]); subplot(2,2,3); plot(wwhp/pi, phahp/pi); axis([0, M, -1.1, 1.1]); grid on;
xlabel('frequency in \pi nuits'); ylabel('radians in \pi units'); title('Highpass Filter Phase Response');
set(gca, 'XTickMode', 'manual', 'XTick', [0, 0.4586, 0.6, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [-1:1:1]); subplot(2,2,4); plot(wwhp/pi, grdhp); axis([0, M, 0, 15]); grid on;
xlabel('frequency in \pi units'); ylabel('Samples'); title('Highpass Filter Group Delay');
set(gca, 'XTickMode', 'manual', 'XTick', [0, 0.4586, 0.6, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [0:5:15]);
运行结果:
《DSP using MATLAB》示例Example 8.27的更多相关文章
- 《DSP using MATLAB》Problem 7.27
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 5.27
代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Outp ...
- 《DSP using MATLAB》Problem 8.27
7月底,又一个夏天,又一个火热的夏天,来到火炉城武汉,天天高温橙色预警,到今天已有二十多天. 先看看住的地方 下雨的时候是这样的 接着做题 代码: %% ----------------------- ...
- 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, ...
随机推荐
- JavaScript权威指南--词法结构
使用广泛,所有的浏览器(桌面.手机.屏蔽等等)都配有相应的JavaScript解析器. JavaScript解析器如何工作? 浏览器在读取HTML文件的时候,只有当遇到<script>标签 ...
- 尽量不要使用using namespace std
C++标准程序库中的所有标识符都被定义于一个名为std的namespace中. namespace是指标识符的各种可见范围.命名空间用关键字namespace 来定义.命名空间是C++的一种机制,用来 ...
- 如何在 Ubuntu 中安装 QGit 客户端
QGit是一款由Marco Costalba用Qt和C++写的开源的图形界面 Git 客户端.它是一款可以在图形界面环境下更好地提供浏览版本历史.查看提交记录和文件补丁的客户端.它利用git命令行来执 ...
- mongo docker image
mongo 保存压缩镜像 docker save -o ~/Desktop/mongo.tar mongo 7za a -mx=9 ~/Desktop/mongo.tar{.7z,} 导入或拉取镜像 ...
- day18 分页+form验证+中间件
参考课件: http://www.cnblogs.com/wupeiqi/articles/6144178.html http://www.cnblogs.com/wupeiqi/articles/5 ...
- 转:HDFS运行原理
简介 HDFS(Hadoop Distributed File System )Hadoop分布式文件系统.是根据google发表的论文翻版的.论文为GFS(Google File System)Go ...
- MySQL使用通用二进制格式安装
CentOS7安装MySQL的方法之通用二进制格式
- [sqlite] 数据库遇到的问题 “该字符串未被识别为有效的 DateTime”
异常详细信息: System.FormatException: 该字符串未被识别为有效的 DateTime. 解决方案: 在日期保存到Sqlite数据库时转换一个类型,比如:string _now = ...
- ViewBag、ViewData、TempData之间的区别
1.ViewBag and ViewData(非跨视图访问) 1)ViewBag是一种dynamic动态类型,用户可以自定义属性并为其赋值,它会在运行时动态解析(例:可以作为变量.数组等各种对象传递并 ...
- Java基础学习-泛型概述和测试
1.举例 首先先用集合来写个自定义对象存储并且去遍历. package genericity; import java.util.ArrayList; import java.util.Collect ...