Filter out constant of integration?

Click For Summary
SUMMARY

The discussion centers on integrating signals from an oscilloscope using the cumtrapz function, with a focus on addressing the constant of integration. Users suggest that while the cumtrapz function is appropriate, the challenge arises from non-clean sine functions. Techniques such as applying the Fourier transform and subtracting the mean value from the signal are recommended to eliminate the constant of integration, allowing for oscillation around zero. The conversation emphasizes the importance of understanding the behavior of sine functions and their integration in practical applications.

PREREQUISITES
  • Understanding of numerical integration techniques, specifically cumtrapz.
  • Familiarity with Fourier transforms and their application in signal processing.
  • Knowledge of sine functions and their properties in calculus.
  • Basic skills in signal analysis using oscilloscopes.
NEXT STEPS
  • Research advanced techniques for signal processing using MATLAB or Python libraries.
  • Learn about the application of Fourier transforms in noisy signal environments.
  • Explore methods for calculating and subtracting the mean from oscillatory signals.
  • Investigate the implications of the constant of integration in various integration techniques.
USEFUL FOR

Signal processing engineers, physicists, and anyone involved in analyzing and integrating oscilloscopic data for cleaner signal representation.

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
 
You can simply calculate the average y value and subtract that from your signal.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 1 ·
Replies
1
Views
8K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
10K
  • · Replies 2 ·
Replies
2
Views
30K
  • · Replies 13 ·
Replies
13
Views
12K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
11K