# integral filter

Assume we have a time domain signal: s(i), i=1:N.

To apply a derivative filter to it, i.e. D*s, where * denotes the convolution, we can simply use the finite difference to approximate it as:

w(i) = ( s(i+1)-s(i) ) / dt;


where w is the signal after time derivative. My question is how to go back to s, i.e. apply an integral filter to w, i.e. I*w? Can I do it like this?

s(1)=0;
for i=2:N
s(i) = s(i-1) + w(i)*dt;
end


Another way to see the relation to continuous time: $$\int \frac{dx(t)}{dt}dt = x(t)+C$$, $$C$$ being the offset you have to determine by an initial condition.