rectangular function
{{Short description|Function whose graph is 0, then 1, then 0 again, in an almost-everywhere continuous way}}
{{Redirect|Box function|the Conway box function|Minkowski's question-mark function#Conway box function}}
{{Use American English|date = March 2019}}
Image:Rectangular function.svg
The rectangular function (also known as the rectangle function, rect function, Pi function, Heaviside Pi function,{{cite web |url=https://reference.wolfram.com/language/ref/HeavisidePi.html |title=HeavisidePi, Wolfram Language function |author=Wolfram Research |date=2008 |access-date=October 11, 2022}} gate function, unit pulse, or the normalized boxcar function) is defined as{{MathWorld |title=Rectangle Function |id=RectangleFunction}}
\left\{\begin{array}{rl}
0, & \text{if } |t| > \frac{a}{2} \\
\frac{1}{2}, & \text{if } |t| = \frac{a}{2} \\
1, & \text{if } |t| < \frac{a}{2}.
\end{array}\right.
Alternative definitions of the function define to be 0,{{Cite book |last=Wang |first=Ruye |title=Introduction to Orthogonal Transforms: With Applications in Data Processing and Analysis |pages=135–136 |publisher=Cambridge University Press |year=2012 |url=https://books.google.com/books?id=4KEKGjaiJn0C&pg=PA135 |isbn=9780521516884 }} 1,{{Cite book |last=Tang |first=K. T. |title=Mathematical Methods for Engineers and Scientists: Fourier analysis, partial differential equations and variational models |page=85 |publisher=Springer |year=2007 |url=https://books.google.com/books?id=gG-ybR3uIGsC&pg=PA85 |isbn=9783540446958 }}{{Cite book |last=Kumar |first=A. Anand |title=Signals and Systems |publisher=PHI Learning Pvt. Ltd. |pages=258–260 |url=https://books.google.com/books?id=FGGa6BXhy3kC&pg=PA258 |isbn=9788120343108 |year=2011 }} or undefined.
Its periodic version is called a rectangular wave.
History
The rect function has been introduced 1953 by Woodward{{Cite journal |last=Klauder |first=John R |title=The Theory and Design of Chirp Radars |pages=745–808 |journal=Bell System Technical Journal |year=1960 |volume=39 |issue=4 |doi=10.1002/j.1538-7305.1960.tb03942.x |url=https://ieeexplore.ieee.org/document/6773600 |url-access=subscription }} in "Probability and Information Theory, with Applications to Radar"{{Cite book |last=Woodward |first=Philipp M |title=Probability and Information Theory, with Applications to Radar |publisher=Pergamon Press |pages=29 |year=1953 }} as an ideal cutout operator, together with the sinc function{{Cite book |last=Higgins |first=John Rowland |title=Sampling Theory in Fourier and Signal Analysis: Foundations |pages=4 |publisher=Oxford University Press Inc. |year=1996 |isbn=0198596995 }}{{Cite book |last=Zayed |first=Ahmed I |title=Handbook of Function and Generalized Function Transformations |pages=507 |publisher=CRC Press |year=1996 |isbn=9780849380761 }} as an ideal interpolation operator, and their counter operations which are sampling (comb operator) and replicating (rep operator), respectively.
Relation 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
Fourier transform of the rectangular function
File:Sinc_function_(normalized).svg
The unitary Fourier transforms of the rectangular function are
=\frac{\sin(\pi f)}{\pi f} = \operatorname{sinc}(\pi f) =\operatorname{sinc}_\pi(f),
using ordinary frequency {{mvar|f}}, where is the normalized formWolfram MathWorld, https://mathworld.wolfram.com/SincFunction.html of the sinc function and
=\frac{1}{\sqrt{2\pi}}\cdot \frac{\sin\left(\omega/2 \right)}{\omega/2}
=\frac{1}{\sqrt{2\pi}} \cdot \operatorname{sinc}\left(\omega/2 \right),
using angular frequency , where is the unnormalized form of the sinc function.
For , its Fourier transform is
=a \frac{\sin(\pi af)}{\pi af} = a\ \operatorname{sinc}_\pi{(a f)}.
Relation to the triangular function
We can define the triangular function as the convolution of two rectangular functions:
Use in probability
{{Main |Uniform distribution (continuous)}}
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.
Rational approximation
The pulse function may also be expressed as a limit of a rational function:
=Demonstration of validity=
First, we consider the case where Notice that the term is always positive for integer However, and hence approaches zero for large
It follows that:
Second, we consider the case where Notice that the term is always positive for integer However, and hence grows very large for large
It follows that:
Third, we consider the case where We may simply substitute in our equation:
We see that it satisfies the definition of the pulse function. Therefore,
0 & \mbox{if } |t| > \frac{1}{2} \\
\frac{1}{2} & \mbox{if } |t| = \frac{1}{2} \\
1 & \mbox{if } |t| < \frac{1}{2}. \\
\end{cases}
Dirac delta function
The rectangle function can be used to represent the Dirac delta function .{{Cite book |last1=Khare |first1=Kedar |title=Fourier Optics and Computational Imaging |last2=Butola |first2=Mansi |last3=Rajora |first3=Sunaina |publisher=Springer |year=2023 |isbn=978-3-031-18353-9 |edition=2nd |pages=15–16 |chapter=Chapter 2.4 Sampling by Averaging, Distributions and Delta Function |doi=10.1007/978-3-031-18353-9}} 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
= \int_{-\infty}^\infty \delta (t) \cdot e^{-i 2\pi f t} \, dt
= \lim_{a \to 0} \frac{1}{a} \int_{-\infty}^\infty \operatorname{rect}\left(\frac{t}{a}\right)\cdot e^{-i 2\pi f t} \, dt
= \lim_{a \to 0} \operatorname{sinc}{(a f)}.
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.