Rectangular function

From HandWiki
Short description: Function whose graph is 0, then 1, then 0 again, in an almost-everywhere continuous way
Rectangular function with a = 1

The rectangular function (also known as the rectangle function, rect function, Pi function, Heaviside Pi function,[1] gate function, unit pulse, or the normalized boxcar function) is defined as[2]

[math]\displaystyle{ \operatorname{rect}\left(\frac{t}{a}\right) = \Pi\left(\frac{t}{a}\right) = \left\{\begin{array}{rl} 0, & \text{if } |t| \gt \frac{a}{2} \\ \frac{1}{2}, & \text{if } |t| = \frac{a}{2} \\ 1, & \text{if } |t| \lt \frac{a}{2}. \end{array}\right. }[/math]

Alternative definitions of the function define [math]\displaystyle{ \operatorname{rect}\left(\pm\frac{1}{2}\right) }[/math] to be 0,[3] 1,[4][5] or undefined.

Its periodic version is called a rectangular wave.

History

The rect function has been introduced by Woodward[6] in [7] as an ideal cutout operator, together with the sinc function[8][9] 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:

[math]\displaystyle{ \operatorname{rect}\left(\frac{t-X}{Y} \right) = H(t - (X - Y/2)) - H(t - (X + Y/2)) = H(t - X + Y/2) - H(t - X - Y/2) }[/math]

where [math]\displaystyle{ H(x) }[/math] is the Heaviside step function; the function is centered at [math]\displaystyle{ X }[/math] and has duration [math]\displaystyle{ Y }[/math], from [math]\displaystyle{ X-Y/2 }[/math] to [math]\displaystyle{ X+Y/2. }[/math]

Fourier transform of the rectangular function

Plot of normalized [math]\displaystyle{ \operatorname{sinc}(x) }[/math] function (i.e. [math]\displaystyle{ \operatorname{sinc}(\pi x) }[/math]) with its spectral frequency components.

The unitary Fourier transforms of the rectangular function are[2] [math]\displaystyle{ \int_{-\infty}^\infty \operatorname{rect}(t)\cdot e^{-i 2\pi f t} \, dt =\frac{\sin(\pi f)}{\pi f} = \operatorname{sinc}_\pi(f), }[/math] using ordinary frequency f, where [math]\displaystyle{ \operatorname{sinc} \pi }[/math] is the normalized form[10] of the sinc function and [math]\displaystyle{ \frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty \operatorname{rect}(t)\cdot e^{-i \omega t} \, dt =\frac{1}{\sqrt{2\pi}}\cdot \frac{\sin\left(\omega/2 \right)}{\omega/2} =\frac{1}{\sqrt{2\pi}} \operatorname{sinc}\left(\omega/2 \right), }[/math] using angular frequency [math]\displaystyle{ \omega }[/math], where [math]\displaystyle{ \operatorname{sinc} }[/math] is the unnormalized form of the sinc function.

For [math]\displaystyle{ \operatorname{rect} (x/a) }[/math], its Fourier transform is[math]\displaystyle{ \int_{-\infty}^\infty \operatorname{rect}\left(\frac{t}{a}\right)\cdot e^{-i 2\pi f t} \, dt =a \frac{\sin(\pi af)}{\pi af} = a\ \operatorname{sinc}_\pi{(a f)}. }[/math]Note that as long as the definition of the pulse function is only motivated by its behavior in the time-domain experience, there is no reason to believe that the oscillatory interpretation (i.e. the Fourier transform function) should be intuitive, or directly understood by humans. However, some aspects of the theoretical result may be understood intuitively, as finiteness in time domain corresponds to an infinite frequency response. (Vice versa, a finite Fourier transform will correspond to infinite time domain response.)

Relation to the triangular function

We can define the triangular function as the convolution of two rectangular functions:

[math]\displaystyle{ \operatorname{tri} = \operatorname{rect} * \operatorname{rect}.\, }[/math]

Use in probability

Main page: Uniform distribution (continuous)

Viewing the rectangular function as a probability density function, it is a special case of the continuous uniform distribution with [math]\displaystyle{ a = -1/2, b = 1/2. }[/math] The characteristic function is

[math]\displaystyle{ \varphi(k) = \frac{\sin(k/2)}{k/2}, }[/math]

and its moment-generating function is

[math]\displaystyle{ M(k) = \frac{\sinh(k/2)}{k/2}, }[/math]

where [math]\displaystyle{ \sinh(t) }[/math] is the hyperbolic sine function.

Rational approximation

The pulse function may also be expressed as a limit of a rational function:

[math]\displaystyle{ \Pi(t) = \lim_{n\rightarrow \infty, n\in \mathbb(Z)} \frac{1}{(2t)^{2n}+1}. }[/math]

Demonstration of validity

First, we consider the case where [math]\displaystyle{ |t|\lt \frac{1}{2}. }[/math] Notice that the term [math]\displaystyle{ (2t)^{2n} }[/math] is always positive for integer [math]\displaystyle{ n. }[/math] However, [math]\displaystyle{ 2t\lt 1 }[/math] and hence [math]\displaystyle{ (2t)^{2n} }[/math] approaches zero for large [math]\displaystyle{ n. }[/math]

It follows that: [math]\displaystyle{ \lim_{n\rightarrow \infty, n\in \mathbb(Z)} \frac{1}{(2t)^{2n}+1} = \frac{1}{0+1} = 1, |t|\lt \tfrac{1}{2}. }[/math]

Second, we consider the case where [math]\displaystyle{ |t|\gt \frac{1}{2}. }[/math] Notice that the term [math]\displaystyle{ (2t)^{2n} }[/math] is always positive for integer [math]\displaystyle{ n. }[/math] However, [math]\displaystyle{ 2t\gt 1 }[/math] and hence [math]\displaystyle{ (2t)^{2n} }[/math] grows very large for large [math]\displaystyle{ n. }[/math]

It follows that: [math]\displaystyle{ \lim_{n\rightarrow \infty, n\in \mathbb(Z)} \frac{1}{(2t)^{2n}+1} = \frac{1}{+\infty+1} = 0, |t|\gt \tfrac{1}{2}. }[/math]

Third, we consider the case where [math]\displaystyle{ |t| = \frac{1}{2}. }[/math] We may simply substitute in our equation:

[math]\displaystyle{ \lim_{n\rightarrow \infty, n\in \mathbb(Z)} \frac{1}{(2t)^{2n}+1} = \lim_{n\rightarrow \infty, n\in \mathbb(Z)} \frac{1}{1^{2n}+1} = \frac{1}{1+1} = \tfrac{1}{2}. }[/math]

We see that it satisfies the definition of the pulse function. Therefore,

[math]\displaystyle{ \operatorname{rect}(t) = \Pi(t) = \lim_{n\rightarrow \infty, n\in \mathbb(Z)} \frac{1}{(2t)^{2n}+1} = \begin{cases} 0 & \mbox{if } |t| \gt \frac{1}{2} \\ \frac{1}{2} & \mbox{if } |t| = \frac{1}{2} \\ 1 & \mbox{if } |t| \lt \frac{1}{2}. \\ \end{cases} }[/math]

Dirac delta function

The rectangle function can be used to represent the Dirac delta function [math]\displaystyle{ \delta (x) }[/math].[11] Specifically,[math]\displaystyle{ \delta (x) = \lim_{a \to 0} \frac{1}{a}\operatorname{rect}\left(\frac{x}{a}\right). }[/math]For a function [math]\displaystyle{ g(x) }[/math], its average over the width [math]\displaystyle{ a }[/math] around 0 in the function domain is calculated as,

[math]\displaystyle{ g_{avg}(0) = \frac{1}{a} \int\limits_{- \infty}^{\infty} dx\ g(x) \operatorname{rect}\left(\frac{x}{a}\right). }[/math] To obtain [math]\displaystyle{ g(0) }[/math], the following limit is applied,

[math]\displaystyle{ g(0) = \lim_{a \to 0} \frac{1}{a} \int\limits_{- \infty}^{\infty} dx\ g(x) \operatorname{rect}\left(\frac{x}{a}\right) }[/math] and this can be written in terms of the Dirac delta function as, [math]\displaystyle{ g(0) = \int\limits_{- \infty}^{\infty} dx\ g(x) \delta (x). }[/math]The Fourier transform of the Dirac delta function [math]\displaystyle{ \delta (t) }[/math] is

[math]\displaystyle{ \delta (f) = \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)}. }[/math] where the sinc function here is the normalized sinc function. Because the first zero of the sinc function is at [math]\displaystyle{ f = 1 / a }[/math] and [math]\displaystyle{ a }[/math] goes to infinity, the Fourier transform of [math]\displaystyle{ \delta (t) }[/math] is

[math]\displaystyle{ \delta (f) = 1, }[/math] 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.

See also

References

  1. Wolfram Research (2008). "HeavisidePi, Wolfram Language function". https://reference.wolfram.com/language/ref/HeavisidePi.html. 
  2. 2.0 2.1 Weisstein, Eric W.. "Rectangle Function". http://mathworld.wolfram.com/RectangleFunction.html. 
  3. Wang, Ruye (2012). Introduction to Orthogonal Transforms: With Applications in Data Processing and Analysis. Cambridge University Press. pp. 135–136. ISBN 9780521516884. https://books.google.com/books?id=4KEKGjaiJn0C&pg=PA135. 
  4. Tang, K. T. (2007). Mathematical Methods for Engineers and Scientists: Fourier analysis, partial differential equations and variational models. Springer. p. 85. ISBN 9783540446958. https://books.google.com/books?id=gG-ybR3uIGsC&pg=PA85. 
  5. Kumar, A. Anand (2011). Signals and Systems. PHI Learning Pvt. Ltd.. pp. 258–260. ISBN 9788120343108. https://books.google.com/books?id=FGGa6BXhy3kC&pg=PA258. 
  6. Klauder, John R (1960). "The Theory and Design of Chirp Radars". Bell System Technical Journal 39 (4): 745–808. doi:10.1002/j.1538-7305.1960.tb03942.x. https://ieeexplore.ieee.org/document/6773600. 
  7. Woodward, Philipp M (1953). Probability and Information Theory, with Applications to Radar. Pergamon Press. pp. 29. 
  8. Higgins, John Rowland (1996). Sampling Theory in Fourier and Signal Analysis: Foundations. Oxford University Press Inc.. pp. 4. ISBN 0198596995. 
  9. Zayed, Ahmed I (1996). Handbook of Function and Generalized Function Transformations. CRC Press. pp. 507. ISBN 9780849380761. 
  10. Wolfram MathWorld, https://mathworld.wolfram.com/SincFunction.html
  11. Khare, Kedar; Butola, Mansi; Rajora, Sunaina (2023). "Chapter 2.4 Sampling by Averaging, Distributions and Delta Function". Fourier Optics and Computational Imaging (2nd ed.). Springer. pp. 15-16. doi:10.1007/978-3-031-18353-9. ISBN 978-3-031-18353-9.