Filter out constant of integration?

In summary, the conversation discusses different methods for integrating a signal received on an oscilloscope and subtracting off a constant of integration. The use of cumtrapz and FFT are mentioned and it is noted that the signals may not be clean sine waves. It is suggested to take the mean and subtract it off to see if the numerical integration can give the desired result.
  • #1
Helmholtzerton
30
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
  • #2
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.
 
  • #3
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.
 
  • #4
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
 
  • #5
You can simply calculate the average y value and subtract that from your signal.
 

1. What is the constant of integration?

The constant of integration is an arbitrary constant that appears in the solution to a differential equation. It is added to the solution because the derivative of a constant is always 0, so it does not affect the overall solution.

2. Why do we need to filter out the constant of integration?

Filtering out the constant of integration allows us to find the specific solution to a differential equation. Without filtering it out, the solution would be a family of curves rather than a single curve.

3. How do we filter out the constant of integration?

To filter out the constant of integration, we need to have initial or boundary conditions for the differential equation. We can then use these conditions to solve for the specific value of the constant and eliminate it from the solution.

4. Can we always filter out the constant of integration?

No, in some cases, the constant of integration cannot be filtered out because there are not enough initial or boundary conditions given. This means that the solution will remain as a family of curves rather than a specific curve.

5. Is filtering out the constant of integration necessary for all types of differential equations?

No, not all differential equations require filtering out the constant of integration. In some cases, the constant may already be given or the differential equation may not have any constants at all.

Similar threads

Replies
0
Views
679
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
5K
Replies
1
Views
674
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
8K
  • General Math
Replies
3
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
951
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
3
Views
1K
Back
Top