Filter out constant of integration?

Click For Summary

Discussion Overview

The discussion revolves around techniques for integrating signals received from an oscilloscope, specifically addressing the challenge of removing a constant of integration from the results. Participants explore various methods and considerations related to numerical integration and signal processing, including the use of Fourier transforms and averaging.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant expresses concern that the cumtrapz function may not yield the correct value for integrating non-clean sine functions and seeks methods to subtract a constant of integration.
  • Another participant clarifies that a definite integral does not have a constant of integration and discusses the implications of summing from i=1 to i.
  • A different participant agrees that the integral appears correct but notes that an arbitrary constant can be added to yield another function with the same derivative, suggesting the mean could be subtracted.
  • One participant elaborates on the need to subtract a constant of integration to oscillate around zero, providing an example with sine functions and discussing the challenges posed by non-clean signals.
  • Another participant suggests calculating the average y value of the signal and subtracting it to address the offset issue.

Areas of Agreement / Disagreement

Participants express differing views on the treatment of constants of integration in the context of definite integrals and numerical integration techniques. There is no consensus on a single method to effectively remove the constant from the integration results.

Contextual Notes

The discussion highlights the limitations of numerical integration techniques when applied to noisy signals and the dependence on the cleanliness of the data for effective signal processing.

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
9K
  • · Replies 1 ·
Replies
1
Views
3K
  • · 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