A few months back, when I was starting to get interested in building electronic circuits again, I thought it would be useful to have an oscilloscope. I came across several web pages describing how to use the headphone/microphone socket on an Android phone with some open source software to make a really cheap scope that would work at audio bandwidths. Based on one of the pages (which I can't find now), I knocked up a 10:1 probe consisting of a FET, a capacitors for uncoupling the DC and some resistors. I tried this with a couple of programs: OsciPrime and XYZ-Apps Oscilloscope, running on a very old Nexus 1.
I connected it up to a small, fixed frequency oscillator with sine, square and triangle wave output, this Velleman kit. Here's how the sine wave looks on OsciPrime:
If you can tell from the out of focus photograph, it looks OK.
Here's the triangle wave:
Here is the alleged square wave:
Many months later, a kind friend made me guardian of his old Tektronics 465 so now I can see what the Velleman signal generator is really producing. Here's the square and triangle waves:
So what was going on with the square wave and to a lesser degree with the triangle wave? Based on some simulation, I think it that as well as losing the higher harmonics, there is a phase shift on the remaining ones, and the shift is different at each frequency. 45 degrees on each of the odd harmonics results in something close to the observed square wave. I assume the Androids audio circuitry or the software behind it does this. I wonder why.