OK, I'm just going to declare today rs20-has-pedantic-hat-day: Triangle integrates to something vaguely sine-ish, but not a true sine wave -- only a (co)sine wave integrates to give a sine wave. However, it's true that as you keep on integrating over and over again, you get closer and closer to a sine wave as you attenuate those harmonics more and more: square --> triangle --> vaguely sine-ish string of parabolas --> even more sine-ish string of cubics --> (infinity* steps later) --> sine --> sine --> sine

* Where infinity is defined as anything greater than, oh, I dunno, seven.

This resonates with the Fourier transform, and with the Taylor series expansion of sin(x). (Screw pedantism, he's bringing out the calculus? Head for the hills!!)

The expansion is all even (cos) or odd (sin) powers of x from 1 or 2 to n, each with a leading coefficient of 1/n!. This is a true representation of the function, but only as long as n --> infty. There's no reason it has to work for small n, though as it turns out, sin/cos are suitable functions which approximate reasonably well. So, the more powers you have, the more accurate the approximation.

Now, one nice thing about a Taylor series is, it's trivial to integrate -- it's just a polynomial, so you increment each exponent by one, and divide the constant. The power goes up, and the approximation gets better (assuming you bring in new constant terms every time you hit +/- cos) because the series 'grows'.

The Fourier transform of a square wave (and its subsequent integrals) follows a similar pattern: the harmonics goes as 1/n^(p+1), where p is the number of integrations. A square wave has harmonics that go as 1/n, so the 3rd has an amplitude of 1/3, and so on. Triangle goes as 1/n^2, so the harmonics drop off more quickly. Each time you integrate, it goes lower and lower, until after infinite passes, the harmonics completely disappear.

When it comes to circuits, if you're talking single frequency (not the variable output from a function generator), the harmonics can be attenuated with a filter. An integrator is simply a -20dB/decade everywhere, so it's as good as a lowpass filter if the unity gain frequency is appropriately selected. Practically speaking, the lowest harmonics are the hardest to treat, and you can get better performance with a filter that incorporates zeroes (like an elliptical) at strategic frequencies.

Indeed, noise doesn't matter, it's the offset between the average value and zero that will determine the deviation of the integral. That's also why integrals give nice curves even on noisy data: they're inherently averaging things together.

Arguably not: low frequency noise tends to go as 1/f, which looks like Brownian noise in the integral, and depending on your point of view and scale, manifests as low frequency rumble, uncertain offset, etc.

There's also the matter of quantization: on average, it's just noise -- but for a given situation, it may not be incoherent. That is, if your 8 bit ADC is always reading the same numbers for each point on the waveform, averaging won't get you anything, because the noise is correlated with, and now inseparable from, the signal. It actually pays to have a slightly noisy measurement (1-2 LSBs, say) when you're doing averaging (or oversampling). BTW, note that averaging is the same as equivalent time sampling (with averaging), because it doesn't matter whether the acquisition was obtained in real time (bursts of a screen at a time) or here-and-there (delayed or random trigger per point).

Tim