Rectangular function: Difference between revisions

Content deleted Content added
Tags: Mobile edit Mobile web edit Advanced mobile edit
 
(31 intermediate revisions by 24 users not shown)
Line 1:
{{Short description|Function whose graph is 0, then 1, then 0 again, in an almost-everywhere continuous way}}
{{for|the periodic version|Rectangular wave}}
{{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|300px|thumb|right|Rectangular function with a = 1]]
 
The '''rectangular function''' (also known as the '''rectangle function''', '''rect function''', '''Pi function''', '''Heaviside Pi function''',<ref>{{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}}</ref> '''gate function''', '''unit pulse''', or the '''normalized [[boxcar function]]''') is defined as<ref name="wolfram">{{MathWorld |title=Rectangle Function |id=RectangleFunction}}</ref>
 
<math display="block">\operatorname{rect}\left(\frac{t}{a}\right) = \Pi\left(\frac{t}{a}\right) =
\left\{\begin{array}{rl}
0, & \text{if } |t| > \frac{1a}{2} \\
\frac{1}{2}, & \text{if } |t| = \frac{1a}{2} \\
1, & \text{if } |t| < \frac{1a}{2}.
\end{array}\right.</math>
 
Alternative definitions of the function define <math display="inline">\operatorname{rect}\left(\pm\frac{1}{2}\right)</math> to be 0,<ref>{{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 }}</ref> 1,<ref>{{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 }}</ref><ref>{{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 }}</ref> or undefined.

Its However,periodic this mid-point property, as defined here,version is requiredcalled (see e.g. Theorem 2, p.&nbsp;241 in <ref>{{Cite book |last=Kaplan |first=Wilfred |title=Operational Methods for Linear Systems |publisher=Addison-Wesley Pub. Co. |year=1962 }}</ref>) to be consistent with Fourier transform theory, otherwise thea ''rect'' function is not the Fourier transform of [[Sincrectangular function|wave]]''sinc'' function]].
 
==History==
The ''rect'' function has been introduced 1953 by [[Philip Woodward|Woodward]]<ref>{{Cite bookjournal |last=Klauder |first=John R |title=The Theory and Design of Chirp Radars |pages=745–808 |publisherjournal=Bell System Technical Journal |year=1960 |volume=39 |issue=4 |doi=10.1002/j.1538-7305.1960.tb03942.x |url=https://ieeexplore.ieee.org/stampdocument/stamp.jsp?arnumber=6773600 |url-access=subscription }}</ref> in "Probability and Information Theory, with Applications to Radar"<ref>{{Cite book |last=Woodward |first=Philipp M |title=Probability and Information Theory, with Applications to Radar |publisher=Pergamon Press |pages=29 |year=1953 }}</ref> as an ideal [[Window function#Rectangular window|cutout operator]], together with the [[Sinc function|''sinc'' function]]<ref>{{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 }}</ref><ref>{{Cite book |last=Zayed |first=Ahmed I |title=Handbook of Function and Generalized Function Transformations |pages=507 |publisher=CRC Press |year=1996 |isbn=9780849380761 }}</ref> as an ideal [[Whittaker–Shannon interpolation formula|interpolation operator]], and their counter operations which are [[Sampling (signal processing)|sampling]] ([[Dirac comb#Dirac-comb identity|''comb'' operator]]) and [[Periodic summation|replicating]] ([[Dirac comb#Dirac-comb identity|''rep'' operator]]), respectively.
 
==Relation to the boxcar function==
The rectangular function is a special case of the more general [[boxcar function]]:
 
<math display=block>\operatorname{rect}\left(\frac{t-X}{Y} \right) = uH(t - (X - Y/2)) - uH(t - (X + Y/2)) = uH(t - X + Y/2) - uH(t - X - Y/2)</math>
 
where <math>u</math> is the [[Heaviside function]]; the function is centered at <math>X</math> and has duration <math>Y</math>, from <math>X-Y/2</math> to <math>X+Y/2.</math>
 
where <math>uH(x)</math> is the [[Heaviside step function]]; the function is centered at <math>X</math> and has duration <math>Y</math>, from <math>X-Y/2</math> to <math>X+Y/2.</math>
==Fourier transform of the rectangular function==
[[File:Sinc_function_(normalized).svg|thumb|400px|right|Plot of normalisednormalized <math>\mathrmoperatorname{sinc}(x)</math> function (i.e. <math>\mathrmoperatorname{sinc}(\pi x)</math>) with its spectral frequency components.]]
 
The [[Fourier transform#Tables of important Fourier transforms|unitary Fourier transforms]] of the rectangular function are<ref name="wolfram"/>
<math display="block">\int_{-\infty}^\infty \mathrmoperatorname{rect}(t)\cdot e^{-i 2\pi f t} \, dt
=\frac{\sin(\pi f)}{\pi f} = \mathrmoperatorname{sinc}{(\pi f) =\operatorname{sinc}_\pi(f),</math>
using ordinary frequency {{mvar|f}}, where [[sinc function|<math>\operatorname{sinc}_\pi</math>]] is the normalized form<ref>Wolfram MathWorld, https://mathworld.wolfram.com/SincFunction.html</ref> of the [[sinc function]] and
using ordinary frequency {{mvar|f}}, and
<math display="block">\frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty \mathrmoperatorname{rect}(t)\cdot e^{-i \omega t} \, dt
=\frac{1}{\sqrt{2\pi}}\cdot \frac{\mathrm{sin}\left(\omega/2 \right)}{\omega/2}
=\frac{1}{\sqrt{2\pi}} \mathrmcdot \operatorname{sinc}\left(\omega/2 \right),
</math>
using angular frequency <math>\omega</math>, where [[sinc function|<math>\mathrmoperatorname{sinc}</math>]] is the unnormalized form of the [[sinc function]].
 
For <math>\operatorname{rect} (x/a)</math>, its Fourier transform is<math display="block">\int_{-\infty}^\infty \operatorname{rect}\left(\frac{t}{a}\right)\cdot e^{-i 2\pi f t} \, dt
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.)
=a \frac{\sin(\pi af)}{\pi af} = a\ \operatorname{sinc}_\pi{(a f)}.</math>
 
==Relation to the triangular function==
We can define the [[triangular function]] as the [[convolution]] of two rectangular functions:
 
<math display=block>\mathrmoperatorname{tri(t/T)} = \mathrmoperatorname{rect(2t/T)} * \mathrmoperatorname{rect(2t/T)}.\,</math>
 
==Use in probability==
Line 61 ⟶ 62:
The pulse function may also be expressed as a limit of a [[rational function]]:
 
<math display="block">\Pi(t) = \lim_{n\rightarrow \infty, n\in \mathbb(Z)} \frac{1}{(2t)^{2n}+1}.</math>
 
===Demonstration of validity===
Line 67 ⟶ 68:
 
It follows that:
<math display="block">\lim_{n\rightarrow \infty, n\in \mathbb(Z)} \frac{1}{(2t)^{2n}+1} = \frac{1}{0+1} = 1, |t|<\fractfrac{1}{2}.</math>
 
Second, we consider the case where <math display="inline">|t|>\frac{1}{2}.</math> Notice that the term <math display="inline">(2t)^{2n}</math> is always positive for integer <math>n.</math> However, <math>2t>1</math> and hence <math display="inline">(2t)^{2n}</math> grows very large for large <math>n.</math>
 
It follows that:
<math display="block">\lim_{n\rightarrow \infty, n\in \mathbb(Z)} \frac{1}{(2t)^{2n}+1} = \frac{1}{+\infty+1} = 0, |t|>\fractfrac{1}{2}.</math>
 
Third, we consider the case where <math display="inline">|t| = \frac{1}{2}.</math> We may simply substitute in our equation:
 
<math display="block">\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} = \fractfrac{1}{2}.</math>
 
We see that it satisfies the definition of the pulse function. Therefore,
 
<math display="block">\mathrmoperatorname{rect}(t) = \Pi(t) = \lim_{n\rightarrow \infty, n\in \mathbb(Z)} \frac{1}{(2t)^{2n}+1} = \begin{cases}
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}</math>
 
== Dirac delta function ==
The rectangle function can be used to represent the [[Dirac delta function]] <math>\delta (x)</math>.<ref name=":0">{{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}}</ref> Specifically,<math display="block">\delta (x) = \lim_{a \to 0} \frac{1}{a}\operatorname{rect}\left(\frac{x}{a}\right).</math>For a function <math>g(x)</math>, its average over the width ''<math>a</math>'' around 0 in the function ___domain is calculated as,
 
<math display="block">g_{avg}(0) = \frac{1}{a} \int\limits_{- \infty}^{\infty} dx\ g(x) \operatorname{rect}\left(\frac{x}{a}\right).</math>
To obtain <math>g(0)</math>, the following limit is applied,
 
<math display="block">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 display="block">g(0) = \int\limits_{- \infty}^{\infty} dx\ g(x) \delta (x).</math>The Fourier transform of the Dirac delta function <math>\delta (t)</math> is
 
<math display="block">\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>f = 1 / a</math> and <math>a</math> goes to infinity, the Fourier transform of <math>\delta (t)</math> is
 
<math display="block">\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==
*[[Fourier transform]]
*[[Square wave (waveform)|Square wave]]
*[[Step function]]
*[[Top-hat filter]]
*[[Boxcar function]]
 
==References==