《DSP using MATLAB》示例Example 8.28
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Exameple 8.28 \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 Filter Specifications: Chebyshev-1 hignpass
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 % Calculation of Chebyshev-1 filter parameters:
[N, wn] = cheb1ord(wp/pi, ws/pi, Rp, As); % Digital Chebyshev-1 Highpass Filter Design:
[bhp, ahp] = cheby1(N, Rp, wn, 'high'); [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.28')
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('Magnitude Response');
set(gca, 'XTickMode', 'manual', 'XTick', [0, 0.4586, 0.6, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [0, 0.1778, 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('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('Phase Response');
set(gca, 'XTickMode', 'manual', 'XTick', [0, 0.4586, 0.6, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [-1:0.5:1]); subplot(2,2,4); plot(wwhp/pi, grdhp); axis([0, M, 0, 10]); 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:2:10]);
运行结果:
《DSP using MATLAB》示例Example 8.28的更多相关文章
- 《DSP using MATLAB》Problem 5.28
昨晚手机在看X信的时候突然黑屏,开机重启都没反应,今天维修师傅说使用时间太长了,还是买个新的吧,心疼银子啊! 这里只放前两个小题的图. 代码: 1. %% ++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 8.28
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》Problem 7.28
又是一年五一节,朋友圈都是晒名山大川的,晒脑袋的,我这没钱的待在家里上网转转吧 频率采样法设计带通滤波器,过渡带中有一个样点 代码: %% ++++++++++++++++++++++++++++++ ...
- 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, ...
随机推荐
- sqlserver 遍历表
use Research go ); ) NOT NULL, [mrs] date); DECLARE Table_Cursor CURSOR FOR--包含有列‘sigdate’的表 select ...
- cygwin 获取root高级权限
cygwin安装完成后没有passwd文件解决方法
- [Vue]使用axios实现ajax请求
1.定义myAjax export const myAjax=function createHttpClient(ajaxConfig) { let httpClient = null; if ...
- 《Think in Java》(十一)持有对象
Java 中的持有对象就是容器啦,看完这一章粗略的了解了 Java 中的容器框架以及常用实现!但是容器框架中的接口以及实现类有好多,下午还得好好看看第 17 章--容器深入研究以及 Java 官方的文 ...
- Jenkins基础复习
- winmm.dll获取和设置声音
[DllImport("winmm.dll")] private static extern int waveOutGetVolume(IntPtr hwo, out uint d ...
- fis 前端构建工具
1.http://fis.baidu.com/ (前端构建工具)
- 【Python】什么是闭包
文章转载自:点这里 在 Python 中很多教材都没有提及什么是闭包,但在定义一个 Decorator 时,就已经用到闭包了.如果不理解什么是闭包,则不可能清晰掌握Decorator 装饰器. 要形成 ...
- MD5加密(java和c#)
java代码 public static String md5(String str) { try { MessageDigest md = MessageDigest.getInstance(&qu ...
- 【Html 学习笔记】第八节——表单实践
列举一些实践的例子: 1.点击按钮后跳转: <html> <body> <form action="1.html"> First <inp ...