《信号与系统》 实验二 卷积的实现

平台

实验指导书
信号实验一和实验二.pdf

第一大题

题目1

计算
f 1 = g 10 ( t − 5 ) f_1=g_{10}(t-5) f1=g10(t5)

f 2 = g 24 ( t − 12 ) f_2=g_{24}(t-12) f2=g24(t12)
的卷积结果.

code

%第一大题第1小问
%第一大题第1小问
f1=@(t)(heaviside(t+0)-heaviside(t-10));
f2=@(t)(heaviside(t+0)-heaviside(t-24));
f3=conv(f1(-10:30),f2(-10:30));
subplot(3,1,1);
ezplot(f1,[-10 30]);
subplot(3,1,2);
ezplot(f2,[-10 30]);
subplot(3,1,3);
x = -20:60;
plot(x,f3);
axis([-10,40,0,15]);

结果

在这里插入图片描述

题目2

计算
f 1 = g 10 ( t − 5 ) f_1=g_{10}(t-5) f1=g10(t5)

f 2 = g 20 ( t − 5 ) f_2=g_{20}(t-5) f2=g20(t5)
的卷积结果.
根据第一题修改一下参数就可以了

code


%第一大题第2小问
f1=@(t)(heaviside(t+0)-heaviside(t-10));
f2=@(t)(heaviside(t+5)-heaviside(t-15));
f3=conv(f1(-50:50),f2(-50:50));
subplot(3,1,1);
ezplot(f1,[-10 30]);
subplot(3,1,2);
ezplot(f2,[-10 30]);
subplot(3,1,3);
x = -100:100;
plot(x,f3);
axis([-10,30,0,15]);

结果

在这里插入图片描述

第二大题

题目

计算
f 1 = g 10 ( t − 5 ) f_1=g_{10}(t-5) f1=g10(t5)

f 2 = e − t u ( t ) f_2=e^{-t}u\left(t\right) f2=etu(t)

code


t = 0:0.1:30;
f1=@(t)(heaviside(t+0)-heaviside(t-10));
f2=@(t)(exp(-t).*stepfun(t,0));
f3=conv(f1(-50:50),f2(-50:50));
subplot(3,1,1);
ezplot(f1,[-10 30]);
subplot(3,1,2);
ezplot(f2,[-10 30 0 1.2]);
subplot(3,1,3);
x = -100:100;
plot(x,f3);
axis([-10,30,0,2]);

结果

在这里插入图片描述

讲解

conv(x,h)卷积函数

w = conv(u,v) returns the convolution of vectors u and v. If u and v are vectors of polynomial coefficients, convolving them is equivalent to multiplying the two polynomials.

ezplot()

ezplot(fun,[xmin,xmax]) plots fun(x) over the domain: xmin < x < xmax.

stepfun(T,T0)或heaviside(x)阶跃信号的绘制

matlab怎么画阶跃函数波形
stepfun(T,T0), where T is a monotonically increasing vector,
returns a vector the same length as T with zeros where T < T0
and ones where T >= T0.

heaviside(x)绘制门函数

heaviside(x) returns the value 0 for x < 0, 1 for x > 0, and 1/2 for x = 0.
f1=@(t)(heaviside(t+t1)-heaviside(t-t2));

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值