That code I showed before,
syms x(t) shifted_x(t)
x(t) = evalin(symengine, 'piecewise([0 <= t and t < 2, exp(t)/2], [2 <= t and t < 4, 2*t-8], [t < 0 or t >= 4, 0])');
shifted_x(t) = x(-t-1);
is the Symbolic Toolbox implementation of a piecewise function. This is something that I would not expect very many people to know.
syms F(t)
F(t) = -exp(t)/2 * heaviside(-2 + t) + exp(t)/2 * heaviside(t) - (2 * t - 8) * heaviside(-4 + t) + (2 * t -8 ) * heaviside(-2 + t) + dirac(t)*(1/2) + dirac(t-2)*(-4)
The value of heaviside at the point where the parameter is 0 is something that can be adjusted with sympref() from R2015a onwards. The issue here is that heaviside(t) is 0 for t < 0 and is 1 for t > 0, but what is it at exactly t = 0 ? The dirac() is there to give explicit values at the boundary conditions the energy of a signal F is var(F)
In turn, var(F(t)) is E(F(t)^2)-E(F(t))^2 where E standards for expected value. The expected value of F(t) is int(t*F(t), t, -inf, inf)
You can now put those formulas together with heaviside version of your piecewise functions to come up with a value for their energies. F(t) and F(-1-t) are the formula...
Best Answer