⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ha2hz_im.m

📁 经典《信号与系统》教程的matlab例程,对深入理解信号与系统相关概念有很大帮助
💻 M
字号:
% Name:Ha2Hz_im
% This program is used to compute the system function from
% an analog lowpass filter using the impusle invariance transformation
% b:The numerator coefficient vector of Ha(s)
% a:The denominator coefficient vec
clear,close all
b=input('Type in the numerator coefficient vector of analog filter:');
a=input('Type in the denomintor coefficient vector of analog filter:');
T=input('Type in the sampling period :');
% omega=input('Type in the maximum analog frequency :');
[bz,az]=impinvar(b,a,1/T);
bz
az
%==========================================================================
[H,w]=freqz(bz,az);
%=================================================================
[Ha,wa]=freqs(b,a);
H0=max(abs(H));Ha0=max(abs(Ha));

subplot(222)
plot(w/pi,abs(H)/H0);
title('Amplitude response of digital filter'),
ylabel('|H|'),axis([0,1,0,1.1*max(abs(H)/H0)]),grid on
subplot(224)
plot(w/pi,20*log(abs(H)/H0));
ylabel('dB'),axis([0,1,-80,0]),
xlabel('Frequency (pi)'),grid on
subplot(221)
plot(wa/(2*pi),abs(Ha)/Ha0);
title('Amplitude response of analog filter'),
ylabel('|Ha|'),axis([0,1,0,1.1*max(abs(Ha)/Ha0)]),grid on
subplot(223)
plot(wa/(2*pi),20*log(abs(Ha)/Ha0));
ylabel('dB'),axis([0,1,-80,0]),
xlabel('Frequency (Hz)'),grid on

⌨️ 快捷键说明

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