《DSP using MATLAB》示例Example4.12
上代码:
b = [0, 1, 1]; a = [1, -0.9, 0.81]; % [R, p, C] = residuez(b,a); Mp = (abs(p))'
Ap = (angle(p))'/pi %% ----------------------------------------------
%% START a determine H(z) and sketch
%% ----------------------------------------------
figure('NumberTitle', 'off', 'Name', 'Example4.12 H(z) its pole-zero plot')
set(gcf,'Color','white');
zplane(b,a);
title('pole-zero plot'); grid on; %% ----------------------------------------------
%% END
%% ---------------------------------------------- %% --------------------------------------------------------------
%% START b |H| <H
%% 1st form of freqz
%% --------------------------------------------------------------
[H,w] = freqz(b,a,100); % 1st form of freqz magH = abs(H); angH = angle(H); realH = real(H); imagH = imag(H); %% ================================================
%% START H's mag ang real imag
%% ================================================
figure('NumberTitle', 'off', 'Name', 'Example4.12 H its mag ang real imag');
set(gcf,'Color','white');
subplot(2,2,1); plot(w/pi,magH); grid on; %axis([0,1,0,1.5]);
title('Magnitude Response');
xlabel('frequency in \pi units'); ylabel('Magnitude |H|');
subplot(2,2,3); plot(w/pi, angH/pi); grid on; % axis([-1,1,-1,1]);
title('Phase Response');
xlabel('frequency in \pi units'); ylabel('Radians/\pi'); subplot('2,2,2'); plot(w/pi, realH); grid on;
title('Real Part');
xlabel('frequency in \pi units'); ylabel('Real');
subplot('2,2,4'); plot(w/pi, imagH); grid on;
title('Imaginary Part');
xlabel('frequency in \pi units'); ylabel('Imaginary');
%% ==================================================
%% END H's mag ang real imag
%% ================================================== %% ---------------------------------------------------------------
%% END b |H| <H
%% --------------------------------------------------------------- %% --------------------------------------------------------------
%% START b |H| <H
%% 3rd form of freqz
%% --------------------------------------------------------------
w = [0:1:100]*pi/100; H = freqz(b,a,w);
%[H,w] = freqz(b,a,200,'whole'); % 3rd form of freqz magH = abs(H); angH = angle(H); realH = real(H); imagH = imag(H); %% ================================================
%% START H's mag ang real imag
%% ================================================
figure('NumberTitle', 'off', 'Name', 'Example4.12 using 3rd form freqz ');
set(gcf,'Color','white');
subplot(2,2,1); plot(w/pi,magH); grid on; %axis([0,1,0,1.5]);
title('Magnitude Response');
xlabel('frequency in \pi units'); ylabel('Magnitude |H|');
subplot(2,2,3); plot(w/pi, angH/pi); grid on; % axis([-1,1,-1,1]);
title('Phase Response');
xlabel('frequency in \pi units'); ylabel('Radians/\pi'); subplot('2,2,2'); plot(w/pi, realH); grid on;
title('Real Part');
xlabel('frequency in \pi units'); ylabel('Real');
subplot('2,2,4'); plot(w/pi, imagH); grid on;
title('Imaginary Part');
xlabel('frequency in \pi units'); ylabel('Imaginary');
%% ==================================================
%% END H's mag ang real imag
%% ================================================== %% ---------------------------------------------------------------
%% END b |H| <H
%% ---------------------------------------------------------------
结果:
《DSP using MATLAB》示例Example4.12的更多相关文章
- DSP using MATLAB 示例 Example3.12
用到的性质 代码: n = -5:10; x = sin(pi*n/2); k = -100:100; w = (pi/100)*k; % freqency between -pi and +pi , ...
- DSP using MATLAB 示例Example2.12
代码: b = [1]; a = [1, -0.9]; n = [-5:50]; h = impz(b,a,n); set(gcf,'Color','white'); %subplot(2,1,1); ...
- 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.11
用到的性质 上代码: n = -5:10; x = rand(1,length(n)); k = -100:100; w = (pi/100)*k; % freqency between -pi an ...
- DSP using MATLAB 示例 Example3.10
用到的性质 上代码: n = -5:10; x = rand(1,length(n)) + j * rand(1,length(n)); k = -100:100; w = (pi/100)*k; % ...
- 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 ...
随机推荐
- 数据结构-链表实现删除全部特定元素x
链表节点类定义: template <class T> class SingleList; template <class T> class Node { private: T ...
- 创建DLL、Lib以及使用DLL、Lib
1.要在生成DLL文件的同时生成Lib文件,函数声明时前面要加__declspec(dllexport). 可在头文件中如下定义: #ifndef __MYDLL_H#define __MYDLL_H ...
- PHP超全局变量
PHP提供了九种超全局变量(数组) 1 $_GET //地址栏上获得的值 2 $_POST //POST表单发送的数据 3 $_REQUEST //GET和POST的内容全都有 4 $_SERVER ...
- 并发用户数与 TPS 之间的关系
1. 背景 在做性能测试的时候,很多人都用并发用户数来衡量系统的性能,觉得系统能支撑的并发用户数越多,系统的性能就越好:对TPS不是非常理解,也根本不知道它们之间的关系,因此非常有必要进行解释. 2 ...
- HTML5 – 3.加强版ol
<ol> 标签定义了一个有序列表. 列表排序以数字来显示. 使用<li> 标签来定义列表选项. 提示和注释 提示: 如果需要无序列表,请使用 <ul> 标签. 提示 ...
- ASP.NET Web API 数据验证
第一种方式单独为每一个Action做验证 // POST api/values public HttpResponseMessage Post([FromBody]UserInfo userInfo) ...
- SQLAlchemy ORM高级查询之过滤,排序
order_by,filter的语法. 用久了才会熟悉. Session = sessionmaker(bind=engine) session = Session() print(session.q ...
- 如何减少JS的全局变量污染
A,唯一变量 B,闭包
- NBU expired Media,Media ID not found in EMM database
Subject:When attempting to expire a media in Veritas NetBackup (tm) 6.0 with the bpexpdate command, ...
- oracle限制ip訪問
我這oracle版本為11.2.0.4,裝的GRID,所以在grid用戶下編輯sqlnet.ora 1.cd /grid/product/11.2.0/network/admin 2.編輯sqlne ...