dfilter.m
来自「经典《信号与系统》教程的matlab例程,对深入理解信号与系统相关概念有很大帮助」· M 代码 · 共 26 行
M
26 行
% dfilter
h=input('Type in the right-sided coefficient vector:');
a=1;%input('Type in the left-sided coefficient vector:');
L=length(h);
n=0:79;
b=zeros(1,80);
for i=1:L
b(i)=h(i);
end
h=b;
zi=zeros(1,length(h)-1);
x=input('Type in the input sequence x(n)=');
y=filter(h,a,x,zi);
subplot(311)
stem(n,h,'.');
title('The impulse response h(n)')
subplot(312)
stem(n,x,'r.')
ylabel('The input sequence x(n)')
subplot(313)
stem(n,y,'r.')
ylabel('y(n)')
%axis([0 80 -1.2 4]);
xlabel('Index n')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?