Rectangular function
Function whose graph is 0, then 1, then 0 again, in an almost-everywhere continuous way

The rectangular function (also known as the rectangle function, rect function, Pi function, Heaviside Pi function, gate function, unit pulse, or the normalized boxcar function) is defined as
Alternative definitions of the function define to be 0, 1, or undefined. The area under the curve does not change for the different definitions of the functions at
.
The rectangular function can be used as the basis for a rectangular wave.
01History
The rect function has been introduced 1953 by Woodward in "Probability and Information Theory, with Applications to Radar" as an ideal cutout operator, together with the sinc function as an ideal interpolation operator, and their counter operations which are sampling (comb operator) and replicating (rep operator), respectively.

02Relation to the boxcar function
The rectangular function is a special case of the more general boxcar function:
where is the Heaviside step function; the function is centered at
and has duration
, from
to
03Fourier transform of the rectangular function
The unitary Fourier transforms of the rectangular function are
using ordinary frequency f, where
is the normalized form of the sinc function and
using angular frequency
, where
is the unnormalized form of the sinc function.
For , its Fourier transform is
04Self convolution of the Rectangular function
The self convolution of the dis-continuous rectangular function results in the triangular function, a piecewise defined spline that is continuous, but not continuously differentiable. Successive convolutions of the rectangular function result in piecewise defined pulses with lower maximums which are wider and smoother, with "smoother" meaning higher-order derivatives are continuous.
A convolution of the discontinuous rectangular function with itself results in the triangular function, which is a continuous function:
Self convolution of the rectangular function applied twice yields a continuous and differentiably continuous parabolic spline:
A self convolution of the rectangular function applied three times yields a continuous, and a second order differentiably continuous cubic spline:
A self convolution of the rectangular function applied four times yields a continuous, and a third order differentiably continuous 4th order spline:
Since the Fourier transform of the rectangular function is the Sinc function, the convolution theorem implies that the Fourier transform of pulses resulting from successive convolutions of the rectangular function with itself is simply the Sinc function to the order of the number of times that the convolution function was applied + 1 (i.e., the Fourier transform of the triangular function is Sinc2, the Fourier transform of the parabolic spline resulting from two successive convolutions of the rectangular function with itself is Sinc3, etc.)

05Use in probability
Viewing the rectangular function as a probability density function, it is a special case of the continuous uniform distribution with The characteristic function is
and its moment-generating function is
where is the hyperbolic sine function.
06Rational approximation
The pulse function may also be expressed as a limit of a rational function:
07Dirac delta function
The rectangle function can be used to represent the Dirac delta function . Specifically,
For a function
, its average over the width
around 0 in the function domain is calculated as,
To obtain
, the following limit is applied,
and this can be written in terms of the Dirac delta function as,
The Fourier transform of the Dirac delta function
is
where the sinc function here is the normalized sinc function. Because the first zero of the sinc function is at
and
goes to infinity, the Fourier transform of
is
means that the frequency spectrum of the Dirac delta function is infinitely broad. As a pulse is shorten in time, it is larger in spectrum.
Sources and credits
This article is adapted from the Wikipedia article “Rectangular function”, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.
Images, from Wikimedia Commons:
- Rectangular function.svg by Unknown author, CC BY-SA 3.0
- Sinc function (normalized).svg by Omegatron, CC BY-SA 3.0
- Splines resulting from successive convolution of the unit Rect function.png by Green Montanan, CC0
Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.