Given the following signal:
$$ x(n) = \left\{ \begin{array}{ll} u(0.01n-0.025)2.3704e^{(-0.287682n)}, & n\ge 0 \\ u(-(0.01n+0.025))2.3704e^{(0.287682n)}, & n< 0 \\ \end{array} \right. $$
I'm finding the energy using the summation formula:
$$E_{x(n)}=\sum_{n=-\infty}^\infty |x(n)|^2=\sum_{n=0}^\infty(2.3704e^{(-0.287682n)}u(0.01n-0.025))^2+\sum_{n=-\infty}^0 (2.3704e^{(0.287682n)}u(-(0.01n+0.025)))^2 =\sum_{n=0}^\infty(2.3704e^{(-0.287682n)}u(0.01n-0.025))^2+\sum_{n=0}^\infty(2.3704e^{(-0.287682n)}u(-(0.01n+0.025)))^2 = 2\times2.3704^2\times \sum_{n=0}^\infty (e^{(-0.287682\times 2)}u(0.01n-0.025))^n$$
So due to the sampling frequency and other information given about the problem, the sampling doesn't start until $n=3$ so I adjusted the limits of summation and removed the u(n) function:
$$=2\times2.3704^2\times \sum_{n=3}^\infty (e^{(-0.287682\times 2)})^n$$
And then adjusted the series to begin at $n=1$ so I could use the summation formula:
$$=2\times2.3704^2\times(\sum_{n=1}^\infty (e^{(-0.287682\times 2)})^n - (e^{(-0.287682\times 2)})^1 - (e^{(-0.287682\times 2)})^2)$$
So the series converges since the common ratio $<1$ and the sum of the series is:
$$S_{\infty}=\frac{a_1}{1-r}=\frac{(e^{(-0.287682\times 2)})^1}{1-e^{(-0.287682\times 2)}}=1.2857$$
Replacing the number above in the energy summation equation, I get:
$$E_{x(n)}=2\times 2.3704^2\times(1.2857-0.5625-0.3164)=4.5715$$
However, when I use MATLAB to find the energy of the signal using the following code:
E = 0
for i=1:fs+1
E = E + abs(x(i))^2
end
where fs
is the sampling frequency, the code yields the following result:
$$E=2.2858$$
which doesn't match my mathematical method. However, I noticed that the answer that MATLAB gives me is half the answer of what I got by hand. I also know with certainty that the MATLAB answer is correct.
So how do I go from $4.5715$ to $2.2858$? What's the step/reasoning that I'm missing?
Thank you!
fs+1
points? Shouldn't it be as long as possible? $\endgroup$fs+1
line is to compensate for that $\endgroup$