World Library  
Flag as Inappropriate
Email this Article

Triangle wave

Article Id: WHEBN0000052151
Reproduction Date:

Title: Triangle wave  
Author: World Heritage Encyclopedia
Language: English
Subject: Sawtooth wave, Waveform, MOS Technology SID, Alternating current, Function generator
Collection: Fourier Series, Waveforms
Publisher: World Heritage Encyclopedia

Triangle wave

A bandlimited triangle wave pictured in the time domain (top) and frequency domain (bottom). The fundamental is at 220 Hz (A3).
5 seconds of triangle wave at 220 Hz

Problems playing this file? See .

A triangle wave is a non-sinusoidal waveform named for its triangular shape. It is a periodic, piecewise linear, continuous real function.

Like a square wave, the triangle wave contains only odd harmonics, due to its odd symmetry. 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).


  • Harmonics 1
  • Definitions 2
  • See also 3
  • References 4


Animation of the additive synthesis of a triangle wave with an increasing number of harmonics. See Fourier Analysis for a mathematical description.

It is possible to approximate a triangle wave with additive synthesis by adding odd harmonics of the fundamental, multiplying every (4nāˆ’1)th harmonic by āˆ’1 (or changing its phase by Ļ€), and rolling off the harmonics by the inverse square of their relative frequency to the fundamental.

This infinite Fourier series converges to the triangle wave:

\begin{align} x_\mathrm{triangle}(t) & {} = \frac {8}{\pi^2} \sum_{k=0}^\infty (-1)^k \, \frac{ \sin \left( (2k+1) t \right)}{(2k+1)^2} \\ & {} = \frac{8}{\pi^2} \left( \sin ( t)-{1 \over 9} \sin (3 t)+{1 \over 25} \sin (5 t) - \cdots \right) \end{align}


Sine, square, triangle, and sawtooth waveforms

Another definition of the triangle wave, with range from -1 to 1 and period 2a is:

x(t)=\frac{2}{a} \left (t-a \left \lfloor\frac{t}{a}+\frac{1}{2} \right \rfloor \right )(-1)^\left \lfloor\frac{t}{a}+\frac{1}{2} \right \rfloor
where the symbol \scriptstyle \lfloor n \rfloor represent the floor function of n.

Also, the triangle wave can be the absolute value of the sawtooth wave:

x(t)= \left | 2 \left ( {t \over a} - \left \lfloor {t \over a} + {1 \over 2} \right \rfloor \right) \right |

or, for a range from -1 to +1:

x(t)= 2 \left | 2 \left ( {t \over a} - \left \lfloor {t \over a} + {1 \over 2} \right \rfloor \right) \right | - 1

The triangle wave can also be expressed as the integral of the square wave:


A simple equation with a period of 4, with y(0) = 1. As this only uses the modulo operation and absolute value, this can be used to simply implement a triangle wave on hardware electronics with less CPU power:

y(x) = |x\,\bmod\,4 - 2|-1

or, a more complex and complete version of the above equation with a period of 2Ļ€ and starting with y(0) = 0:

y(x) = \left|4\left(\left(\frac{x}{2\pi} - 0.25\right)\,\bmod\,1\right) - 2\right|-1

In terms of sine and arcsine with period p and amplitude a:

y(x) = \frac{2a}{\pi}\arcsin\left(\sin\left(\frac{2\pi}{p}x\right)\right)

See also


This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.