《DSP using MATLAB》Problem 8.18

代码:
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 8.18 \n\n'); banner();
%% ------------------------------------------------------------------------ Wp = 20*pi; Ws = 30*pi; Rp = 0.25; As = 50;
Fp = Wp/(2*pi);
Fs = Ws/(2*pi); Ripple = 10 ^ (-Rp/20)
Attn = 10 ^ (-As/20) % Analog filter design, DIRECT form:
[b, a] = afd('ellip', Fp, Fs, Rp, As);
%[b, a] = afd_elip(Wp, Ws, Rp, As); % Calculation of second-order sections:
[C, B, A] = sdir2cas(b, a); % Calculation of Frequency Response:
[db, mag, pha, ww] = freqs_m(b, a, 35*pi); % Calculation of Impulse Response:
[ha, x, t] = impulse(b, a); %% -------------------------------------------------
%% Plot
%% ------------------------------------------------- figure('NumberTitle', 'off', 'Name', 'Problem 8.18 Lowpass Analog Elliptic')
set(gcf,'Color','white');
M = 1.0; % Omega max subplot(2,2,1); plot(ww/pi, mag); grid on; axis([-45, 45, 0, 1.2]);
xlabel(' Analog frequency in \pi*1k units'); ylabel('|H|'); title('Magnitude in Absolute');
set(gca, 'XTickMode', 'manual', 'XTick', [-30, -20, 0, 20, 30]);
set(gca, 'YTickMode', 'manual', 'YTick', [0, 0.003, 0.97, 1]); subplot(2,2,2); plot(ww/pi, db); grid on; %axis([0, M, -50, 10]);
xlabel('Analog frequency in \pi*1k units'); ylabel('Decibels'); title('Magnitude in dB ');
set(gca, 'XTickMode', 'manual', 'XTick', [-30, -20, 0, 20, 30]);
set(gca, 'YTickMode', 'manual', 'YTick', [-70, -50, -1, 0]);
set(gca,'YTickLabelMode','manual','YTickLabel',['70';'50';' 1';' 0']); subplot(2,2,3); plot(ww/pi, pha/pi); grid on; axis([-45, 45, -1.2, 1.2]);
xlabel('Analog frequency in \pi*1k nuits'); ylabel('radians'); title('Phase Response');
set(gca, 'XTickMode', 'manual', 'XTick', [-30, -20, 0, 20, 30]);
set(gca, 'YTickMode', 'manual', 'YTick', [-1:0.5:1]); subplot(2,2,4); plot(t, ha); grid on; %axis([0, 30, -0.05, 0.25]);
xlabel('time in seconds'); ylabel('ha(t)'); title('Impulse Response');
运行结果:
绝对指标

模拟Elliptical低通,串联形式系数

幅度谱、相位谱和脉冲响应

通带放大

阻带放大

由图可知,通带、阻带,都是等波纹的。
《DSP using MATLAB》Problem 8.18的更多相关文章
- 《DSP using MATLAB》Problem 6.18
		
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
 - 《DSP using MATLAB》Problem 5.18
		
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% O ...
 - 《DSP using MATLAB》Problem 4.18
		
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
 - 《DSP using MATLAB》Problem 3.18
		
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
 - 《DSP using MATLAB》Problem 2.18
		
1.代码: function [y, H] = conv_tp(h, x) % Linear Convolution using Toeplitz Matrix % ----------------- ...
 - 《DSP using MATLAB》Problem 5.15
		
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
 - 《DSP using MATLAB》Problem 4.15
		
只会做前两个, 代码: %% ---------------------------------------------------------------------------- %% Outpu ...
 - 《DSP using MATLAB》Problem 7.27
		
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
 - 《DSP using MATLAB》Problem 7.26
		
注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...
 
随机推荐
- 与960 Grid System相关的那些问题
			
为什么是960px? 一直以来,网页设计师都希望寻找一个理想的页面宽度值,既能适应大部分屏幕,又尽可能的在一行显示更多的信息. 我们首先会考虑的是全屏自适应,但这并非一个好的解决方案.一方面,需要做一 ...
 - 网页开发人员收藏的16款HTML5工具
			
本文收集的20款优秀的 HTML5 Web 应用程序,值得添加到您的 HTML5 的工具箱中,他们能够帮助你开发前端项目更快.更容易. Initializr Initializr 是一个可以让你创建 ...
 - SQLserver执行命令
			
方法一:xp_cmdshell exec master..xp_cmdshell "whoami"默认执行是关闭 EXEC sp_configure 'show advanced ...
 - Android开发 解决Installation failed due to XXX 问题
			
报错信息 Android studio 安装app的时候以下报错 Installation did not succeed. The application could not be installe ...
 - soj114 中位数
			
题意:给你一个长度为2n-1的数组A,设Bi是A的1~2i-1的中位数.问打乱A,有多少种不同的B序列? 标程: #include<bits/stdc++.h> using namespa ...
 - Mysql: [Warning] Using a password on the command line interface can be insecure
			
mysql: [Warning] Using a password on the command line interface can be insecure MySQL 5.6 警告信息 comma ...
 - python 怎么像shell -x 一样追踪脚本运行过程
			
python 怎么像shell -x 一样追踪脚本运行过程 [root@localhost keepalived]# python -m trace --trace mysql_start.py -- ...
 - Flask框架图
 - yii2.0 数据库查询操作
			
User::find()->all(); 此方法返回所有数据: User::findOne($id); 此方法返回 主键 id=1 的一条数据(举个例子): User:: ...
 - div+css对网页进行布局
			
div+css对网页进行布局 首先在页面整体上进行div标签划分内容区域,然后再用css进行定位,最后再对相应的区域添加内容. 1.用div将页面划分 拿到网站页面图后,首先将分析页面分为哪几块,然后 ...