已知信号:f1t=ut+05-ut-1 f2t=05tut-ut-2试求解信号卷积积分 f t=f1tf2t利用matlab写出相关程序
根据卷积积分的定义,有:
f(t) = f1(t) * f2(t) = ∫f1(τ)f2(t-τ)dτ
对于f1(t),有:
f1(t) = u(t+0.5) - u(t-1)
对于f2(t),有:
f2(t) = 0.5t[u(t)-u(t-2)]
将f1(t)和f2(t)代入卷积积分公式中,得:
f(t) = ∫[u(τ+0.5)-u(τ-1)]*0.5(t-τ)[u(t-τ)-u(t-τ-2)]dτ
接下来在MATLAB中编写程序,用quad函数进行数值积分:
syms t tau; f1 = heaviside(t+0.5) - heaviside(t-1); f2 = 0.5t(heaviside(t) - heaviside(t-2)); f = int(f1*subs(f2, t-tau), tau, -inf, inf); f = simplify(f); f = matlabFunction(f); t = -2:0.01:4; y = arrayfun(f, t); plot(t, y); xlabel('t'); ylabel('f(t)'); title('Convolution of f1(t) and f2(t)');
运行代码,得到卷积积分结果的图像
原文地址: https://www.cveoy.top/t/topic/euRv 著作权归作者所有。请勿转载和采集!