已知两连续时间信号如下图所示, 1)写出信号的函数表达式,并计算f(t)=f1(t)* f2(t)的解析表达式; 2)用MATLAB 求f(t)=f1(t)* f2(t),并绘出f(t)的时域波形图。(设定取样时间间隔为dt)
时间: 2023-05-28 13:06:22 浏览: 180
图未能显示,请见谅。
1)根据图像,可以写出两个信号的函数表达式为:
f1(t) = 2u(t+1) - u(t) - u(t-1)
f2(t) = u(t+1) - u(t-2)
其中u(t)为单位阶跃函数。因为两个信号是连续时间信号,所以它们的解析表达式为:
f(t) = f1(t) * f2(t) = [2u(t+1) - u(t) - u(t-1)] * [u(t+1) - u(t-2)]
= 2u(t+1)*[u(t+1)-u(t-2)] - u(t)*[u(t+1)-u(t-2)] - u(t-1)*[u(t+1)-u(t-2)]
= 2u(t+1)u(t+1) - 2u(t+1)u(t-2) - u(t)u(t+1) + u(t)u(t-2) - u(t-1)u(t+1) + u(t-1)u(t-2)
= 2u(t+1)^2 - 2u(t+1)u(t-2) - u(t)u(t+1) + u(t)u(t-2) - u(t-1)u(t+1) + u(t-1)u(t-2)
2)使用MATLAB计算f(t)的时域波形图:
首先设定取样时间间隔为dt=0.01秒,然后编写以下MATLAB代码:
t = -5:0.01:5; % 时间变量
f1 = 2*heaviside(t+1) - heaviside(t) - heaviside(t-1); % f1(t)函数表达式
f2 = heaviside(t+1) - heaviside(t-2); % f2(t)函数表达式
f = conv(f1,f2)*0.01; % 卷积计算f(t)
t_f = -10:0.01:10; % f(t)的时间变量
plot(t_f,f); % 绘制f(t)的时域波形图
运行代码后,即可得到f(t)的时域波形图。
阅读全文