已知一个 LTI 系统 h n =09ⁿ u n 设输入序列为 x n = u n - u n -10试在-550]上产生并画出输入、冲激响应和输出序列。MATLAB
代码如下:
% 定义系统函数
h = 0.9.^(0:49);
% 定义输入序列
n = -5:50;
x = [ones(1,6), zeros(1,5), -ones(1,45)];
% 计算输出序列
y = conv(h,x);
% 绘制图像
subplot(3,1,1);
stem(n,x);
title('输入序列');
xlabel('n');
ylabel('x(n)');
subplot(3,1,2);
stem(0:49,h);
title('冲激响应');
xlabel('n');
ylabel('h(n)');
subplot(3,1,3);
stem(n,y(1:length(n)));
title('输出序列');
xlabel('n');
ylabel('y(n)');
运行结果如下:
原文地址: https://cveoy.top/t/topic/clmG 著作权归作者所有。请勿转载和采集!