I am new to digital signal processing. I have the following sensor sample data
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
Which means at time 0
I have the value 0.30865225195884705
and at time 60
I have the value 0.14355185627937317
and so on.
Data is taken from the sensor at each 10 milliseconds
. So, I assume sampling rate should be set to 100 Hz
.
I want to calculate the total energy of the time domain signal.
I read that it can be calculated using Parseval's theorem as following:
where X[k]
is the DFT
of x[n]
, both of length N
.
Any suggestion, how can I calculate the total energy using MATLAB?