Calculating energy of a signal using symbolic toolbox

1 回表示 (過去 30 日間)
Aaron Connell
Aaron Connell 2016 年 10 月 16 日
回答済み: Gautam Mohan 2016 年 10 月 18 日
I have two piecewise defined functions, x(t) and a reversed and shifted version of x(t) as shown below...I am supposed to use the symbolic toolbox in Matlab to calculate the energy of these two signals and explain how they are related. Not sure what the symbolic toolbox is...is it using syms function? Code for both signals is below.
% code
x = @(t) zeros(size(t)) +(t >= 0 & t < 2).*((1/2)*exp(t)) + (t >= 2 & t < 4).*(2*t-8);
t = linspace(0,6);
plot(t,x(t))
axis([-1 8 -4 4])
xlabel('Time(t)')
ylabel('x(t)')
title('Function x(t)')
% code
x = @(t) zeros(size(t)) +(t >= 0 & t < 2).*((1/2)*exp(t)) + (t >= 2 & t < 4).*(2*t-8);
f = @(t) x(-t-1);
t = linspace(-7, -1);
plot(t,f(t))
axis([-8 1 -4 4])
xlabel('Time(t)')
ylabel('f(t)');
title('Left shift and time reversal of x(t)')

採用された回答

Gautam Mohan
Gautam Mohan 2016 年 10 月 18 日
Hi Aaron,
The syms() function is indeed part of the Symbolic Toolbox. From my understanding, finding the energy of a signal involves taking the integral of its magnitude:
https://en.wikipedia.org/wiki/Energy_(signal_processing)
If you are supposed to use the symbolic function, I would suggest defining each function using piecewise() and then taking the integral of each after computing the magnitude -- both functions are available as part of the Symbolic Toolbox. Here are some links below to get started:
https://www.mathworks.com/help/symbolic/piecewise.html
https://www.mathworks.com/help/symbolic/int.html
Hope this helps!

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by