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 the triangular function. Triangular functions are useful in signal processing and communication systems engineering as representations of idealized signals, and the triangular function specifically as an integral transform kernel function from which more realistic signals can be derived, for example in kernel density estimation. It also has applications in pulse-code modulation as a pulse shape for transmitting digital signals and as a matched filter for receiving the signals. It is also used to define the triangular window sometimes called the Bartlett window.
The most common definition is as a piecewise function:
\begin{align} \operatorname{tri}(x)=Λ(x) &\overset{\underset{def
Equivalently, it may be defined as the convolution of two identical unit rectangular functions:
\begin{align} \operatorname{tri}(x)&=\operatorname{rect}(x)*\operatorname{rect}(x)\\ &=
infty | |
\int | |
-infty |
\operatorname{rect}(x-\tau) ⋅ \operatorname{rect}(\tau)d\tau.\\ \end{align}
The triangular function can also be represented as the product of the rectangular and absolute value functions:
\operatorname{tri}(x)=\operatorname{rect}(x/2)(1-|x|).
Note that some authors instead define the triangle function to have a base of width 1 instead of width 2:
\begin{align} \operatorname{tri}(2x)=Λ(2x) &\overset{\underset{def
In its most general form a triangular function is any linear B-spline:[1]
\operatorname{tri}j(x)=\begin{cases} (x-xj-1)/(xj-xj-1),&xj-1\lex<xj;\\ (xj+1-x)/(xj+1-xj),&xj\lex<xj+1;\\ 0&otherwise. \end{cases}
Whereas the definition at the top is a special case
Λ(x)=\operatorname{tri}j(x),
where
xj-1=-1
xj=0
xj+1=1
f(x)
f(x)
f(x)=\sumjyj ⋅ \operatorname{tri}j(x),
where
xj<xj+1
j
(xj,yj)
f(xj)=yj
For any parameter
a\ne0
\begin{align} \operatorname{tri}\left(\tfrac{t}{a}\right)&=
infty | |
\int | |
-infty |
\tfrac{1}{|a|}\operatorname{rect}\left(\tfrac{\tau}{a}\right) ⋅ \operatorname{rect}\left(\tfrac{t-\tau}{a}\right)d\tau\\ &=\begin{cases} 1-|t/a|,&|t|<|a|;\\ 0&otherwise. \end{cases} \end{align}
The transform is easily determined using the convolution property of Fourier transforms and the Fourier transform of the rectangular function:
\begin{align} l{F}\{\operatorname{tri}(t)\} &=l{F}\{\operatorname{rect}(t)*\operatorname{rect}(t)\}\\ &=l{F}\{\operatorname{rect}(t)\} ⋅ l{F}\{\operatorname{rect}(t)\}\\ &=l{F}\{\operatorname{rect}(t)\}2\\ &=sinc2(f), \end{align}
\operatorname{sinc}(x)=\sin(\pix)/(\pix)