Transients on square wave output
  • I noticed something when I was playing with the new 3.3 version today. I don't know if it occurred with the 3.0 version and I'm not convinced it's a bug in any case. I was looking at a low frequency square wave using the waveform display and I noticed a fair bit of overshoot at the leading edge of the low to high transition and the high to low transition. Strangely the trailing edges looked fine. (see attached). Thinking it might be the waveform display, I used the AU plug-in to gererate a higher frequency square wave in Reaper (my DAW of choice) and noticed the same ringing there. I've tried this on a MacBook Pro, an iMac and an iPad Air 2 all with the same results. Is this the audio hardware ringing or is Audulus itself producing the transients? I've attached both screenshots. I see similar artifacts with the ramp.
    Screen Shot 2016-10-17 at 7.32.40 PM.png
    776 x 570 - 38K
    Screen Shot 2016-10-17 at 7.31.48 PM.png
    838 x 304 - 18K
  • Is this not just the nature of any square wave? Look at this wikipedia entry:

    https://en.wikipedia.org/wiki/Square_wave

    https://en.wikipedia.org/wiki/Square_wave#/media/File:Fourier_series_for_square_wave.gif

    My guess is this has something to do with the anti-aliasing function built into that node. Make one with a phaser and you won't find that same peak. To make a hard edge on the square wave you basically need infinite harmonics which would of course be reflected down into the audible spectrum from the Nyquist frequency.

    The ramp has the same thing because you're talking about an instantaneous change in position that, if idealized, would require infinite velocity.
  • I hadn't considered anti-aliasing. I'm familiar with the concept as it relates to analog to digital conversion, but I never really thought about how it would relate to digitally generated waveforms. The trace certainly resembles the Fourier synthesis of a square wave with the higher order harmonics removed, although in the Fourier synthesis you would have the artifacts on both the leading and trailing edges of each half cycle. Guess I have some more reading to do. Since I started playing with Audulus I've looked at more math than I have since engineering at college. I don't remember seeing this with 3.0 but I can't swear to it. I doubt it makes any difference to the final sound in any case. I'm just curious.
  • @stschoen I am definitely becoming more familiar with trigonometric functions than I have in a decade.