exa145.m

来自「自己整理的信号与系统中的MATLAB应用: 离散系统模型及其MATLAB实现 」· M 代码 · 共 20 行

M
20
字号
%exa145_transfer_function_reponse.m for example 1-45
%transfer function response传递函数响应
clear all;
fs=1000;%sample frequency unit in Hz
b=[0.3 0.2];%system parameter
a=[1 -0.4 -0.7];%system parameter
[h,f]=freqz(b,a,256,fs);
mag=abs(h);%compute magnitude
ph=angle(h);%compete phase
ph=ph*180/pi;%unit in degrees
subplot(2,1,1);
plot(f,mag)
grid
xlabel('frequency(Hz)');
ylabel('magnitude');
subplot(2,1,2)
plot(f,ph)
grid
xlabel('frequency(Hz)');
ylabel('phase');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?