Integral of sin (x): capturing a sinusoidal waveform from analog-to-digital converter

SoftwareMonkey

New member
Joined
Aug 24, 2017
Messages
3
I am integrating a sine wave over 360 degrees by summing values of sin (x) . The answer appears to be correct in that it is a cosine function plus a constant but I have noticed that the amplitude of the output divided by the number of samples i take is always around 0.318. For example for 360 samples the amplitude is 114.588. I am intrugued to know why this is.

Can anyone shed any light on this please?
 
Sorry, but I don't think I understand a word you just said. It's true that \(\displaystyle \displaystyle \int sin(x) \: dx = cos(x) + C\), but the amplitude of cos(x) is always 1, no matter the value of x. The biggest part of why I'm confused is the extremely ambiguous wording of "I am integrating a sine wave over 360 degrees by summing values of sin (x)." That could mean you're doing this integral:

\(\displaystyle \displaystyle \int_{0}^{2\pi} sin(x) \: dx = 0\)

But that's not a function of cosine, nor does it have an amplitude, so I really don't think that's right. Or you could be describing this integral:

\(\displaystyle \displaystyle \int \left( sin(x_1) + sin(x_2) + sin(x_3) + \text{ ... } + sin(x_{360}) \: dx \right)\)

That may or may not equate out to some function \(\displaystyle cos(f(x)) + C\), which might have amplitude ~114.588. But if this is what you're doing, we'd need to know a lot more about the specific values of x_1, x_2, x_3, etc. to even come close to figuring out your mystery.
 
Thanks for the reply, as you have gathered, maths is not my strong point and its been more than 40 years since I last had to worry about integration.

Let me have another go at explaining what I am doing, but I apologize that I can't explain this in mathematical terms.

I am capturing a sinusoidal waveform from an analog-to-digital converter (ADC), where the input signal is proportional to rate of change of current. I need to integrate the signal in order to get a value proportional to the current. I recall from my school days that integrating is like adding up all the little bits of the signal (in this case samples from the ADC). When I do this, I get a cosine waveform (plus constant), so I THINK it is working.

While doing this, I noticed that the peak-to-peak amplitude of the cosine output depended on the number of samples taken over a cycle of input data. When I experimented with different sample rates, the relationship between peak-to-peak of the output waveform to the number of samples was constant. Through my tests, I can predict the peak-to-peak amplitude, but I wondered what the mathematics behind it might be. I am summing the signals like this...

Output 1= input sample 1
Output 2 = output 1 + input sample 2
Output 3 = output 2 + input sample 3
Output 4 = output 3 + input sample 4

And so on. I then plotted the output values and examined the max and min values of each output element, and divide by the number of samples, and out pops 0.318309. I just wondered, why this value?

I hope I have explained this better and not confused you even more!
 
I think that the constant value of 0.3183088 that I am seeing when I do the 'integration' is in fact 1/pi but I would still be interested in why that is.
 
I am capturing a sinusoidal waveform from an analog-to-digital converter (ADC), where the input signal is proportional to rate of change of current. I need to integrate the signal in order to get a value proportional to the current. I recall from my school days that integrating is like adding up all the little bits of the signal (in this case samples from the ADC). When I do this, I get a cosine waveform (plus constant), so I THINK it is working.
I'm still a bit lost as to what you're attempting, and how you're arriving at your results (either a cosine function, or else one numerical value). But I think you may possibly be referring to something along the following lines:



Given that the sinusoidal input signal s is proportion to the rate of change (with respect to time t) of the current I, we have the following relationship:

. . . . .\(\displaystyle s(t)\, =\, a\, \sin(bt\, +\, c)\, =\, p\, \cdot\, \dfrac{dI}{dt}\)

We wish to find a functional expression for the current I as a function of time t. So we integrate:

. . . . .\(\displaystyle a\, \sin(bt\, +\, c)\, =\, p\, \cdot\, \dfrac{dI}{dt}\)

. . . . .\(\displaystyle a\, \sin(bt\, +\, c)\, dt\, =\, p\, dI\)

. . . . .\(\displaystyle \displaystyle \dfrac{a}{p}\, \int \, \sin(bt\, +\, c)\, dt\, =\, \int\, dI\)

. . . . .\(\displaystyle \displaystyle \dfrac{a}{p}\, \int\, \sin(bt\, +\, c)\, dt\, =\, I(t)\)

Is this what you mean? And, if so, what are the specifics of a, b, c, and p? Thank you! ;)
 
Top