title: Calculate energy of time domain data
body: <p>I am new to digital signal processing. I have the following sensor sample data</p>
  
  <pre><code>Time(milliseconds)            data
  ------------------    -------------------
  0                     0.30865225195884705   
  60                    0.14355185627937317   
  100                  -0.16846869885921478   
  156                  -0.2458019256591797    
  198                  -0.19664153456687927
  258                   0.27148059010505676   
  305                  -0.16949564218521118   
  350                  -0.227480947971344 
  397                   0.23532353341579437   
  458                   0.20740140974521637
  </code></pre>
  
  <p>Which means at time <code>0</code> I have the value <code>0.30865225195884705</code> and at time <code>60</code> I have the value <code>0.14355185627937317</code> and so on.</p>
  
  <p>Data is taken from the sensor at each <code>10 milliseconds</code>. So, I assume sampling rate should be set to <code>100 Hz</code>.</p>
  
  <p>I want to calculate the total energy of the time domain signal.</p>
  
  <p>I read that it can be calculated using Parseval's theorem as following:</p>
  
  <p><a href="https://i.stack.imgur.com/GmhYT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GmhYT.jpg" alt="enter image description here"></a></p>
  
  <p>where <code>X[k]</code> is the <code>DFT</code> of <code>x[n]</code>, both of length <code>N</code>.</p>
  
  <p>Any suggestion, how can I calculate the total energy using MATLAB?</p>