Triangle Function — Definition, Formula & Examples
The triangle function (also called the triangular function) is a piecewise linear function that rises linearly from 0 to 1, then falls linearly back to 0, forming a triangle shape. It appears frequently in signal processing and Fourier analysis as a basic waveform.
The triangle function is defined as , which equals for and otherwise. Equivalently, it is the convolution of the rectangular function with itself.
Key Formula
Where:
- = The input variable (often representing time or a normalized coordinate)
- = The absolute value of t, ensuring symmetry about the origin
How It Works
The triangle function peaks at with a value of 1 and decreases linearly to 0 at and . Outside the interval , it is identically zero. You can scale and shift it: centers the peak at and stretches the base to width . In Fourier analysis, the triangle function's transform is , making it a natural window function for smoothing spectral data.
Worked Example
Problem: Evaluate tri(t) at t = −0.5, t = 0, and t = 1.5.
At t = −0.5: Since |−0.5| = 0.5 ≤ 1, use the formula 1 − |t|.
At t = 0: Since |0| = 0 ≤ 1, substitute directly.
At t = 1.5: Since |1.5| = 1.5 > 1, the function equals zero.
Answer: tri(−0.5) = 0.5, tri(0) = 1, and tri(1.5) = 0.
Why It Matters
The triangle function serves as a standard window and interpolation kernel in digital signal processing courses. Engineers use it when designing filters, performing linear interpolation between sampled data points, and analyzing bandwidth through its Fourier transform .
Common Mistakes
Mistake: Confusing the triangle function with a periodic triangle wave.
Correction: The triangle function tri(t) is a single, finite-duration pulse defined on [−1, 1]. A triangle wave is a periodic repetition of triangular segments extending over all t. They are related but distinct objects.
