Convolution of waveforms

Discussion in 'Physics & Math' started by arfa brane, Aug 1, 2012.

  1. arfa brane call me arf Valued Senior Member

    Messages:
    7,832
    Generating waveforms like square and triangular waves is a matter of having some finite number of sinewave sources, giving each of them a frequency which is a harmonic of the lowest or fundamental frequency, and a corresponding amplitude.

    The harmonic part is easy, it's just an integer multiple of the fundamental frequency (which one of the sinewave sources is set to). The amplitudes should correspond to the height of that part of the transform into the frequency domain of each discrete frequency being summed together in the time domain.
    To get a square wave with a 50% duty cycle, you sum odd harmonics and with the fundamental amplitude set to say, 1/π, the nth harmonic's amplitude is set to 1/nπ (up to some arbitrary scaling factor).

    To get a triangular wave using the same number of sources, you sum odd harmonics again, but alternate their sign successively. Their amplitudes need to be 1/n[sup]2[/sup]π.

    Anyway, the upshot is that a triangular wave looks more linear than a square wave built from the same number of sources (the 'frequency cutoff' effect). So, practically it's less costly to generate triangular waveforms than square ones.
    So why is this? Is it because a triangular wave is the convolution of two rect functions per period (so that's why it has more linearity), whereas a square (or rectangular) wave is the convolution of one rect? What does the factor of n[sup]2[/sup] have to do with it?
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. James R Just this guy, you know? Staff Member

    Messages:
    39,397
    To get a finite step you need, in theory, an infinite number of component sine waves. A square wave has finite steps, whereas a triangular wave does not. So, you can get a better approximation to a triangular wave than to a square wave using a Fourier expansion to the same order.
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. arfa brane call me arf Valued Senior Member

    Messages:
    7,832
    Not sure what you mean here.
    A square wave transforms like the rect function, a triangular wave transforms like the convolution of two rect functions.
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. AlphaNumeric Fully ionized Registered Senior Member

    Messages:
    6,702
    The square wave form is not continuous, never mind not differentiable, while the triangular one is continuous which often makes things a bit easier and more stable, hence the faster decay of the amplitude coefficients. In each case you need infinitely many sin's to get them properly and in the case of the square waveform the discontinuity can lead to a Gibbs phenomenon at the discontinuity, so even with infinitely many you have a problem.

    I'm not sure what you mean by the convolution of just one waveform. The convolution operation is a binary operator, it takes in 2 things and gives out 1, ie \((f,g) \to f \ast g\), typically on the space of functions (or appropriately integrable functions). In waveform analysis this is a common combination and is closely linked to the Fourier transform, which everyone loves, right? Do you mean a convolution with itself?
     
  8. arfa brane call me arf Valued Senior Member

    Messages:
    7,832
    This is what wikipedia says:

    "Fourier transform of the rectangular function

    The unitary Fourier transforms of the rectangular function are:[1]

    \( \int_{-\infty}^\infty \mathrm{rect}(t)\cdot e^{-i 2\pi f t} \, dt =\frac{\sin(\pi f)}{\pi f} = \mathrm{sinc}(f) \),

    and:

    \( \frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty \mathrm{rect}(t)\cdot e^{-i \omega t} \, dt =\frac{1}{\sqrt{2\pi}}\cdot \mathrm{sinc}\left(\frac{\omega}{2\pi}\right) \)

    where \( \mathrm{sinc}\) is the normalized form of the sinc function.

    Note that as long as the definition of the pulse function is only motivated by the time-domain experience of it, there is no reason to believe that the oscillatory interpretation (i.e. the Fourier transform function) should be intuitive, or directly understood by humans. However, some aspects of the theoretical result may be understood intuitively, such as the infinite bandwidth requirement incurred by the indefinitely-sharp edges in the time-domain definition.
    [edit]
    Relation to the triangular function

    We can define the triangular function as the convolution of two rectangular functions:

    \( \mathrm{tri}(t) = \mathrm{rect}(t) * \mathrm{rect}(t) \)"

    What I mean is a rectangular wave in the time domain is a sequence of transforms of the same sinc function in the frequency domain.
    With a finite number of sine components you get a distorted square wave, which illustrates the cutoff problem. Distortion is much less for a triangular wave with the same number of components. This suggests that triangular waves are less costly in practical terms to generate than square waves.
     
  9. quadraphonics Bloodthirsty Barbarian Valued Senior Member

    Messages:
    9,391
    Err... that additive method is almost never used to actually generate square waves and triangle waves. Square waves are very easy to generate directly in the time domain with a simple "switching" oscillator. In fact, it is generally much easier to produce a square wave than it is to produce a sine wave, so the method of using a bank of sine waves to make a square wave is really backwards. Triangle waves can be generated from square waves with a very simple integration operator.

    Additive synthesis techniques like you propose (banks of sine wave generators which get modulated and added together) are used for generating more complex waveforms that do not have very simple time-domain behavior. Things like square waves and triangle waves (and sawtooth waves) all have very simple time-domain structures, and so can be generated by very simple time-domain operations.

    Nobody uses additive synthesis to generate either square waves or triangle waves, since either one can be generated much more cheaply and easily directly in the time domain.
     
  10. quadraphonics Bloodthirsty Barbarian Valued Senior Member

    Messages:
    9,391
    The relevant statement here is that the convolution relationship between square waves and triangle waves implies (via the convolution theorem) that the spectrum of a triangle wave is the square of the spectrum of a square wave. That's why you have a \(\frac{1}{n}\) in the spectrum of a square wave, and a \(\frac{1}{n^2}\) in the spectrum of a triangle wave.

    No, additive synthesis is not a "practical" way to generate either square waves or triangle waves in the first place. It's an order of magnitude more expensive than the simple, direct time-domain methods that are actually used to do it. The entire reason those specific waveforms are of general interest, and used as pedagogical examples in teaching transform analysis, is exactly that they are trivial to directly generate in the time domain without knowing anything about transform analysis.

    The only thing that is implied by the faster decay of triangle wave harmonics, is exactly that triangle waves have less high-frequency energy than square waves. This corresponds to the fact that triangle waves are continuous, and square waves are not.
     
  11. arfa brane call me arf Valued Senior Member

    Messages:
    7,832
    Unless you happen to want to understand why using pure sine waves to generate square waves is harder than some other method. I mean, obviously a simple switching circuit will output square waves.

    I suppose I should have qualified the sentence: "This suggests that triangular waves are less costly in practical terms to generate than square waves." with "using sine wave sources".
    The other practical limit is how faithfully a square wave can be transmitted; that is to say, this exercise is about understanding the cutoff effect.
     

Share This Page