Triangle%20wave
   HOME

TheInfoList



OR:

A triangular wave or triangle wave is a non-sinusoidal waveform named for its triangular shape. It is a periodic, piecewise linear,
continuous Continuity or continuous may refer to: Mathematics * Continuity (mathematics), the opposing concept to discreteness; common examples include ** Continuous probability distribution or random variable in probability and statistics ** Continuous g ...
real function. Like a square wave, the triangle wave contains only odd
harmonic A harmonic is a wave with a frequency that is a positive integer multiple of the ''fundamental frequency'', the frequency of the original periodic signal, such as a sinusoidal wave. The original signal is also called the ''1st harmonic'', t ...
s. However, the higher harmonics roll off much faster than in a square wave (proportional to the inverse square of the harmonic number as opposed to just the inverse).


Definitions


Definition

A triangle wave of period ''p'' that spans the range ,1is defined as: x(t)= 2 \left, \frac - \left \lfloor \frac + \frac \right \rfloor \ where \lfloor\,\ \rfloor is the floor function. This can be seen to be the absolute value of a shifted
sawtooth wave The sawtooth wave (or saw wave) is a kind of non-sinusoidal waveform. It is so named based on its resemblance to the teeth of a plain-toothed saw with a zero rake angle. A single sawtooth, or an intermittently triggered sawtooth, is called ...
. For a triangle wave spanning the range the expression becomes: x(t)= 2 \left , 2 \left ( \frac - \left \lfloor + \right \rfloor \right) \right , - 1. A more general equation for a triangle wave with amplitude a and period p using the
modulo operation In computing, the modulo operation returns the remainder or signed remainder of a division, after one number is divided by another (called the '' modulus'' of the operation). Given two positive numbers and , modulo (often abbreviated as ) is ...
and absolute value is: y(x) = \frac \left, \left( \left(x - \frac\right) \bmod p \right) - \frac \ - a. For example, for a triangle wave with amplitude 5 and period 4: y(x) = 5 \bigl , \left( (x - 1) \bmod 4 \right) - 2\bigr , - 5. A phase shift can be obtained by altering the value of the - p/4 term, and the vertical offset can be adjusted by altering the value of the - a term. As this only uses the modulo operation and absolute value, it can be used to simply implement a triangle wave on hardware electronics. Note that in many programming languages, the % operator is a remainder operator (with result the same sign as the dividend), not a
modulo operator In computing, the modulo operation returns the remainder or signed remainder of a division, after one number is divided by another (called the '' modulus'' of the operation). Given two positive numbers and , modulo (often abbreviated as ) is t ...
; the modulo operation can be obtained by using ((x % p) + p) % p in place of x % p. In e.g. JavaScript, this results in an equation of the form 4*a/p * Math.abs((((x-p/4)%p)+p)%p - p/2) - a.


Relation to the square wave

The triangle wave can also be expressed as the
integral In mathematics, an integral assigns numbers to functions in a way that describes displacement, area, volume, and other concepts that arise by combining infinitesimal data. The process of finding integrals is called integration. Along with ...
of the square wave: x(t) = \int_0^t \sgn\left(\sin\frac\right)\,du.


Expression in trigonometric functions

A triangle wave with period ''p'' and amplitude ''a'' can be expressed in terms of sine and arcsine (whose value ranges from −''π''/2 to ''π''/2): y(x) = \frac \arcsin\left(\sin\left(\fracx\right)\right). The identity \cos = \sin\left(\frac-x\right) can be used to convert from a triangle "sine" wave to a triangular "cosine" wave. This phase-shifted triangle wave can also be expressed with cosine and
arccosine In mathematics, the inverse trigonometric functions (occasionally also called arcus functions, antitrigonometric functions or cyclometric functions) are the inverse functions of the trigonometric functions (with suitably restricted domains). S ...
: y(x) = a - \frac \arccos\left(\cos\left(\fracx\right)\right).


Expressed as alternating linear functions

Another definition of the triangle wave, with range from −1 to 1 and period ''p'', is: x(t) = \frac \left (t-\frac \left \lfloor\frac+\frac \right \rfloor \right )(-1)^\left \lfloor\frac + \frac \right \rfloor


Harmonics

It is possible to approximate a triangle wave with
additive synthesis Additive synthesis is a sound synthesis technique that creates timbre by adding sine waves together. The timbre of musical instruments can be considered in the light of Fourier theory to consist of multiple harmonic or inharmonic '' partials'' ...
by summing odd harmonics of the fundamental while multiplying every other odd harmonic by −1 (or, equivalently, changing its phase by ) and multiplying the amplitude of the harmonics by one over the square of their mode number, (which is equivalent to one over the square of their relative frequency to the fundamental). The above can be summarised mathematically as follows: \begin x_\mathrm(t) & = \frac8\sum_^ (-1)^i n^ \sin\left(2\pi f_0 n t\right) \end where is the number of harmonics to include in the approximation, is the independent variable (e.g. time for sound waves), f_0 is the fundamental frequency, and is the harmonic label which is related to its mode number by n = 2i + 1. This infinite
Fourier series A Fourier series () is a summation of harmonically related sinusoidal functions, also known as components or harmonics. The result of the summation is a periodic function whose functional form is determined by the choices of cycle length (or '' ...
converges quickly to the triangle wave as tends to infinity, as shown in the animation.


Arc length

The
arc length ARC may refer to: Business * Aircraft Radio Corporation, a major avionics manufacturer from the 1920s to the '50s * Airlines Reporting Corporation, an airline-owned company that provides ticket distribution, reporting, and settlement services * ...
per period for a triangle wave, denoted by ''s'', is given in terms of the amplitude ''a'' and period length ''p'' by s = \sqrt.


See also

* List of periodic functions *
Sine wave A sine wave, sinusoidal wave, or just sinusoid is a mathematical curve defined in terms of the '' sine'' trigonometric function, of which it is the graph. It is a type of continuous wave and also a smooth periodic function. It occurs often in ...
* Square wave *
Sawtooth wave The sawtooth wave (or saw wave) is a kind of non-sinusoidal waveform. It is so named based on its resemblance to the teeth of a plain-toothed saw with a zero rake angle. A single sawtooth, or an intermittently triggered sawtooth, is called ...
*
Pulse wave A pulse wave or pulse train is a type of non-sinusoidal waveform that includes square waves (duty cycle of 50%) and similarly periodic but asymmetrical waves (duty cycles other than 50%). It is a term used in synthesizer programming, and is ...
*
Sound In physics, sound is a vibration that propagates as an acoustic wave, through a transmission medium such as a gas, liquid or solid. In human physiology and psychology, sound is the ''reception'' of such waves and their ''perception'' by ...
*
Triangle function A triangular function (also known as a triangle function, hat function, or tent function) is a function whose graph takes the shape of a triangle. Often this is an isosceles triangle of height 1 and base 2 in which case it is referred to as ''th ...
*
Wave In physics, mathematics, and related fields, a wave is a propagating dynamic disturbance (change from equilibrium) of one or more quantities. Waves can be periodic, in which case those quantities oscillate repeatedly about an equilibrium (re ...
*
Zigzag A zigzag is a pattern made up of small corners at variable angles, though constant within the zigzag, tracing a path between two parallel lines; it can be described as both jagged and fairly regular. In geometry, this pattern is described as ...


References

* {{DEFAULTSORT:Triangle Wave Fourier series Waveforms