DSP实验报告(一)之离散时间信号和系统的时域分析

一、产生如下因果线性时不变系统的冲激响应的前45个样本并绘图:

在这里插入图片描述

clf;
N = 45;
num = [0.9 -0.45 0.35 0.002];
den = [1 0.71 -0.46 -0.62];
y = impz(num,den,N);
% Plot the impulse response
stem(y);
xlabel('Time index n'); ylabel('Amplitude');
title('Impulse Response'); grid; 

二、对序列 和 求卷积生成 ,并用FIR滤波器 对输入 滤波,求得 ; 和 有差别吗?为什么要使用对 补零后得到的 作为输入来产生 ?

clf;
h = [3 2 1 -2 1 0 -4 0 3];	% impulse response
x = [1 -2 3 -4 3 2 1];		% input sequence
y = conv(h,x);
n = 0:14;
subplot(2,1,1);
stem(n,y);
xlabel('Time index n'); ylabel('Amplitude');
title('Output Obtained by Convolution'); grid;
x1 = [x zeros(1,8)];
y1 = filter(h,1,x1);
subplot(2,1,2);
stem(n,y1);
xlabel('Time index n'); ylabel('Amplitude');
title('Output Generated by Filtering'); grid;

两者图像没有差别。

之所以要x补零,是因为filter的原因。H共9个数,x共7个数,卷积后15个。Filter最后的结果个数是和x相等的,所以要对x补8个0,再加入filter才能得到正确的结果。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ReCclay

如果觉得不错,不妨请我喝杯咖啡

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值