《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 ...
随机推荐
- 表单中Readonly和Disabled的区别(转载)
Readonly和Disabled是用在表单中的两个属性,它们都能够做到使用户不能够更改表单域中的内容.但是它们之间有着微小的差别,总结如下: Readonly只针对input(text / pass ...
- Java异常题库
一.填空题 __异常处理__机制是一种非常有用的辅助性程序设计方法.采用这种方法可以使得在程序设计时将程序的正常流程与错误处理分开,有利于代码的编写和维护. 在Java异常处理中可以使用多个catch ...
- ubuntu下deb包的安装方法
ubuntu下deb包的安装方法 简介 deb是debian linus的安装格式,跟red hat的rpm非常相似,最基本的安装命令是:dpkg -i file.deb dpkg 是Debian P ...
- error TRK0002
运行程序出现error TRK0002的原因是因为3ds max中打开了程序生成的模型,同时使用导致memory conflict,然后随之出现一些乱七八糟的问题. 只要将3ds max重置即可,即不 ...
- 数据结构One_Vector(向量的简单实现)
#include <iostream> using namespace std; template<typename Object> class Vector { privat ...
- HBase参数配置及说明(转)
版本:0.94-cdh4.2.1 hbase-site.xml配置 hbase.tmp.dir 本地文件系统tmp目录,一般配置成local模式的设置一下,但是最好还是需要设置一下,因为很多文件都会默 ...
- 三、jQuery--jQuery基础--jQuery基础课程--第4章 jQuery表单选择器
1.:input表单选择器 如何获取表单全部元素?:input表单选择器可以实现,它的功能是返回全部的表单元素,不仅包括所有<input>标记的表单元素,而且还包括<textarea ...
- Android Tab -- 使用Fragment、FragmentManager来实现
原文地址:http://blog.csdn.net/crazy1235/article/details/42678877 效果: 代码:https://github.com/ldb-github/La ...
- SVM 最大间隔目标优化函数(NG课件2)
目标是优化几何边距, 通过函数边距来表示需要限制||w|| = 1 还是优化几何边距,St去掉||w||=1限制转为普通函数边距 更进一步的,可以固定函数边距为1,调节||w| ...
- MVC中Action 过滤
总结Action过滤器实用功能,常用的分为以下两个方面: 1.Action过滤器主要功能就是针对客服端请求过来的对象行为进行过滤,类似于门卫或者保安的职能,通过Action过滤能够避免一些非必要的深层 ...