Filter out constant of integration?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 3K views
Helmholtzerton
Messages
30
Reaction score
4
Hello,

I'm trying to integrate a signal received on an oscilliscope, but I'm afraid using the function cumtrapz is not giving me the correct value. Here is what I'm seeing when testing out sine functions
cumtrapzQ.png


I could apply an FFt to obtain the components and the phases, and then subtract off the constant of integration. However my signals are not clean sineusoids.

Are there any integration techniques I can apply which can subtract off this constant?
 
Physics news on Phys.org
Summing from i=1 to i doesn't make sense.
A sum or a definite integral won't have a constant of integration. The shown sum is correct (with some interpretation how to resolve the "i" issue), and as you can see the partial sums start at zero - as they should. Removing the last term would make the expression wrong.
 
The integral looks correct to me.

You can, of course, add an arbitrary constant to get another function with the same derivative. For example you can take the mean and subtract that, etc.
 
mfb said:
Summing from i=1 to i doesn't make sense.
A sum or a definite integral won't have a constant of integration. The shown sum is correct (with some interpretation how to resolve the "i" issue), and as you can see the partial sums start at zero - as they should. Removing the last term would make the expression wrong.

Sorry, what I was trying to convey is for all sin functions that comprise of f(x). That is...

Say you have the following f(x) = sin(t) + 3sin(2t+pi/4)

Then the constant of integration to subtract off would be = cos(0)+ 3/2cos(pi/4) = 1+1.0607 = 2.0607

the anti derivative of f(x) = -cos(t) - 3/2*cos(2t+pi/4) + C

I want to subtract off C so that I oscillate about 0.

Below, in the bottom graph, shows this. Where the oscillation is between 2 and -2, where as the top graph is offset.

example.png


This is fairly easy to do with clean signals by just taking the Fourier transform, and applying my formula for the extracted amplitudes, frequency, and phase shift. But signal data from an oscilloscope is not that clean, and so my method won't work for this. The offset that comes from the numerical integration doesn't make physical sense.

I'll try to experiment with taking the mean and subtracting it off to see if the numerical integration of sin(t) can simply give me -cos(t) over all of t instead of -cos(t)+C