DSP using MATLAB 示例Example2.12

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);
stem(n,h); title('Impulse Response');
xlabel('n'); ylabel('h(n)'); grid on; x = stepseq(0, -5, 50) - stepseq(10, -5, 50)
y = filter(b, a, x);
figure; set(gcf,'Color','white');
%subplot(2, 1,2);
stem(n,x); title('Step Sequence');
xlabel('n'); ylabel('x(n)'); grid on; figure; set(gcf,'Color','white');
%subplot(2, 1,2);
stem(n,y); title('Output Sequence');
xlabel('n'); ylabel('y(n)'); axis([-5,50,-0.5,8]);
grid on;

结果:

DSP using MATLAB 示例Example2.12  

DSP using MATLAB 示例Example2.12

DSP using MATLAB 示例Example2.12

上一篇:Entity Framework入门教程(8)---预先加载、延迟加载、显示加载


下一篇:MvcAdmin功能介绍