iPhone Function Generator App - Page 1
Forum section: electronics / testgear

author: Attorney
author_rank: Regular Contributor
timestamp: October 27, 2013, 04:13:55 pm
content: Yesterday, I added an audio function generator application to my iPhone 5. The app is called "Tone Gen Pro" from PerformanceAudio.com.The app worked very well as a way to quickly test a new Class AB audio amp I recently designed. I was not expecting lab-grade results from the iPhone. However, when I ran a square wave test, I was surprised to see about 10% overshoot and ringing on a 100 Hz square wave. Historically, when seeing that characteristic on an audio frequency square wave, it's usually a dead giveaway that a reasonably large inductance (e.g., secondary winding of a poorly designed audio transformer) is terminated into an incorrect impedance. I have no inductors in my Class AB amp, not even for RFI/EMI mitigation.With the iPhone app still running the square wave, I then sampled the iPhone output on my DSO. Whew! At least it wasn't my design that was ringing. It's the output of the iPhone. Back to inductance. There's just no way I can see the iPhone 5 hardware having a large output inductance that would result in overshoot and ringing. No matter how I changed the termination Z, the waveform remained the same.Here's my conclusion, and if you're a Fourier mathematician, please chime in. I am thinking that the application, having either a code or hardware memory limitation is not fully reconstructing the square wave from enough sine waves of varying phase and amplitude.For those not familar with Fourier analysis, any function**, no matter how complex, can be generated with a series of sine waves of varying phase and amplitude. At some point, the app designer must have said "Good enough" given design constraints. The result of a bare minimum sine wave set results in a square wave with some overshoot and ringing. That's my hypothesis but I have no idea if I'm remotely correct.Anyone run into this when using a smartphone function generator app?Paul** In a simplistic definition, a function occurs when an X axis data point is never repeated.

author: Attorney
author_rank: Regular Contributor
timestamp: October 27, 2013, 04:47:57 pm
content: Quote from: Pippy on October 27, 2013, 04:30:50 pmEQ would exacerbate the overshoot & ringing, but there's another mechanism that may be at least partially responsible. The same effect occurs with non-optimized LP filters (e.g., anti-aliasing).The Wikipedia example describes exactly what I'm seeing.http://en.wikipedia.org/wiki/Overshoot_(signal)Paul

author: Flump
author_rank: Frequent Contributor
timestamp: October 27, 2013, 06:22:39 pm
content: i have recently been trying android generator appsand the square waves on all of the apps are rubbish

author: IanB
author_rank: Super Contributor
timestamp: October 27, 2013, 07:08:14 pm
content: It is impossible for a perfect square wave to exist in any analog domain--it can only be approximated. To have a good approximation you need a very wide frequency response in the system especially at the high frequency end of the range.An iPhone does not have a high fidelity audio system, it has an "adequate" audio system suitable for playing music into medium to low fidelity earphones. So it is highly unreasonable to expect the system to produce a reasonable facsimile of a square wave. Square waves do not exist in normal music signals, so why should the designers attempt to support this?

author: JDubU
author_rank: Frequent Contributor
timestamp: October 27, 2013, 07:30:21 pm
content: Quote from: Attorney on October 27, 2013, 04:47:57 pmThat's really interesting.Even without any intended EQ, the use of a digital low pass anti-aliasing filter that uses a kernel containing negative values (e.g. sinc filter) will cause square wave overshoot.Apple engineers probably went without an external analog low pass filter to save space/cost and ignored any potential high frequency artifacts from overshoot since they would essentially be filtered by the limited frequency response of the headphones (and/or be outside the audio frequency range).