What I am after is the center line of this wave, which is 0. How can I calculate that value though?
For example, run the code below for a simple example in Matlab. This will plot a simple sine wave with a couple of periods.
x = linspace(0,7.5*pi,100); y = sin(x); plot(x,y); mean(y)
The result (and the problem) is that
mean(y) is 0.0368, and not 0.
But I am plotting a sine wave oscillating around 0 of course.
How can I calculate these kind of averages correctly (without me having to plot and actually examine each signal manually to get the periods right)?