Rectangular function: Difference between revisions

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
imported>Natsuhata
 
 
Line 2: Line 2:
{{Redirect|Box function|the Conway box function|Minkowski's question-mark function#Conway box function}}
{{Redirect|Box function|the Conway box function|Minkowski's question-mark function#Conway box function}}
{{Use American English|date = March 2019}}
{{Use American English|date = March 2019}}
[[Image:Rectangular function.svg|300px|thumb|right|Rectangular function with a = 1]]
[[Image:Rectangular function.svg|300px|thumb|right|Rectangular function with <math display="inline">T = 1</math>]]


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>
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) =
<math display="block">\operatorname{rect}\left(\frac{t}{T}\right) = \Pi\left(\frac{t}{T}\right) =
\left\{\begin{array}{rl}
\left\{\begin{array}{rl}
  0, & \text{if } |t| > \frac{a}{2} \\
  0, & \text{if } |t| > \frac{T}{2} \\
  \frac{1}{2}, & \text{if } |t| = \frac{a}{2} \\
  \frac{1}{2}, & \text{if } |t| = \frac{T}{2} \\
  1, & \text{if } |t| < \frac{a}{2}.
  1, & \text{if } |t| < \frac{T}{2}.
\end{array}\right.</math>
\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.
Alternative definitions of the function define <math display="inline">\operatorname{rect}\left(t=\pm\frac{T}{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. The area under the curve does not change for the different definitions of the functions at <math display="inline">t=\pm\frac{T}{2}</math>.


Its periodic version is called a ''[[rectangular wave]]''.
The rectangular function can be used as the basis for a ''[[rectangular wave]]''.


==History==
==History==
Line 42: Line 42:
=a \frac{\sin(\pi af)}{\pi af} = a\ \operatorname{sinc}_\pi{(a f)}.</math>
=a \frac{\sin(\pi af)}{\pi af} = a\ \operatorname{sinc}_\pi{(a f)}.</math>


==Relation to the triangular function==
==Self convolution of the Rectangular function==
We can define the [[triangular function]] as the [[convolution]] of two rectangular functions:
[[File:Splines resulting from successive convolution of the unit Rect function.png|thumb|The unit Rectangular function (in which <math display="inline">T=1</math>) along with the [[Piecewise function|piecewise defined]] [[spline (mathematics)|splines]] that result from successive convolutions of the Rectangular function with itself.]]
The [[self convolution]] of the dis-[[Continuous function|continuous]] rectangular function results in the [[triangular function]], a [[Piecewise function|piecewise defined]] [[spline (mathematics)|spline]] that is continuous, but not continuously [[Differentiable function|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 derivative]]s are continuous.<ref>{{cite web|url=https://cyclostationary.blog/2021/01/28/sptk-convolution-and-the-convolution-theorem/|title=SPTK: Convolution and the Convolution Theorem| first= Chad |last= Spooner| date= January 28, 2021}}</ref>


<math display=block>\operatorname{tri(t/T)} = \operatorname{rect(2t/T)} * \operatorname{rect(2t/T)}.\,</math>
A [[convolution]] of the discontinuous rectangular function with itself results in the triangular function, which is a continuous function:
 
<math display=block> \begin{align} \operatorname{rect(2t/T)} * \operatorname{rect(2t/T)} = \operatorname{tri(t/T)} =  
  \begin{cases}
      1 + t, &  -T < t < 0 \\
      1 - t, &  \,\,\,\,\, 0 < t < T \\
      0      & \,\,\,\,\,\text{otherwise} \\
      \end{cases}
\end{align}
</math>
 
Self convolution of the rectangular function applied twice yields a continuous and differentiably continuous parabolic spline:
 
<math display=block> \begin{align} \operatorname{rect(2t/T)} * \operatorname{rect(2t/T)} * \operatorname{rect(2t/T)} = \operatorname{tri(t/T)} * \operatorname{rect(2t/T)} =
  \begin{cases}
      \frac{9}{8} + \frac{3}{2}t + \frac{1}{2}t^2, &  -\frac{3}{2}T < t < -\frac{1}{2}T \\
      \frac{3}{4} - t^2,  &  -\frac{1}{2}T < t < \frac{1}{2}T \\
      \frac{9}{8} - \frac{3}{2}t + \frac{1}{2}t^2, &  \,\,\,\,\, \frac{1}{2}T < t < \frac{3}{2}T \\
      0      & \,\,\,\,\,\text{otherwise} \\
      \end{cases}
\end{align}
</math>
 
A self convolution of the rectangular function applied three times yields a continuous, and a second order differentiably continuous cubic spline:
 
<math display=block> \begin{align}  \operatorname{tri(t/T)} * \operatorname{tri(t/T)} =
  \begin{cases}
      \frac{4}{3} + {2}t + t^2 +\frac{1}{6}t^3 , & -2T  < t < -T \\
      \frac{2}{3} - t^2 - \frac{1}{2}t^3,  &  -T < t < 0 \\
      \frac{2}{3} - t^2 + \frac{1}{2}t^3,  &  \,\,\,\,\,0 < t < T \\
      \frac{4}{3} - {2}t + t^2 -\frac{1}{6}t^3 , & \,\,\,\,\,T  < t < 2T \\
      0      & \,\,\,\,\,\text{otherwise} \\
      \end{cases}
\end{align}
</math>
 
A self convolution of the rectangular function applied four times yields a continuous, and a third order differentiably continuous 4th order spline:
 
<math display=block> \begin{align}  4^{th}\,\text{order spline}  =
  \begin{cases}
      \frac{625}{384} + \frac{125}{48}t + \frac{25}{16}t^2 +\frac{5}{12}t^3 + \frac{1}{24}t^4, & -\frac{5}{2}T  < t < -\frac{3}{2}T \\
      \frac{55}{96} - \frac{5}{24}t - \frac{5}{4} t^2 - \frac{5}{6}t^3 -\frac{1}{6}t^4,  &  -\frac{3}{2}T < t < -\frac{1}{2}T \\
 
      \frac{115}{192} - \frac{5}{8}t^2 + \frac{1}{4}t^4,  &  -\frac{1}{2}T < t < \frac{1}{2}T \\
 
      \frac{55}{96} + \frac{5}{24}t - \frac{5}{4} t^2 + \frac{5}{6}t^3 -\frac{1}{6}t^4,  &  \,\,\,\,\,\frac{1}{2}T < t < \frac{3}{2}T \\
      \frac{625}{384} - \frac{125}{48}t + \frac{25}{16}t^2 -\frac{5}{12}t^3 + \frac{1}{24}t^4, & \,\,\,\,\,\frac{3}{2}T  < t < \frac{5}{2}T \\
 
      0      & \,\,\,\,\,\text{otherwise} \\
      \end{cases}
\end{align}
</math>
 
 
Since the [[Fourier Transform]] of the Rectangular function is the [[Sinc function]], the [[Convolution theorem]] mean that the Fourier transform of pulses resulting from successive convolution 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 Sinc<sup>2</sup>, the Fourier transform of parabolic spline resulting from two successive convolutions of the Rectangular function with itself is Sinc<sup>3</sup>, etc.)


==Use in probability==
==Use in probability==

Latest revision as of 12:47, 27 December 2025

Template:Short description Script error: No such module "redirect hatnote". Template:Use American English

File:Rectangular function.svg
Rectangular function with T=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]

rect⁡(tT)=Π(tT)={0,if |t|>T212,if |t|=T21,if |t|<T2.

Alternative definitions of the function define rect⁡(t=±T2) to be 0,[3] 1,[4][5] or undefined. The area under the curve does not change for the different definitions of the functions at t=±T2.

The rectangular function can be used as the basis for a rectangular wave.

History

The rect function has been introduced 1953 by Woodward[6] in "Probability and Information Theory, with Applications to Radar"[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:

rect⁡(t−XY)=H(t−(X−Y/2))−H(t−(X+Y/2))=H(t−X+Y/2)−H(t−X−Y/2)

where H(x) is the Heaviside step function; the function is centered at X and has duration Y, from X−Y/2 to X+Y/2.

Fourier transform of the rectangular function

File:Sinc function (normalized).svg
Plot of normalized sinc⁡(x) function (i.e. sinc⁡(πx)) with its spectral frequency components.

The unitary Fourier transforms of the rectangular function are[2] ∫−∞∞rect⁡(t)⋅e−i2πftdt=sin⁡(πf)πf=sinc⁡(πf)=sincπ(f), using ordinary frequency Template:Mvar, where sincπ is the normalized form[10] of the sinc function and 12π∫−∞∞rect⁡(t)⋅e−iωtdt=12π⋅sin⁡(ω/2)ω/2=12π⋅sinc⁡(ω/2), using angular frequency ω, where sinc is the unnormalized form of the sinc function.

For rect⁡(x/a), its Fourier transform is∫−∞∞rect⁡(ta)⋅e−i2πftdt=asin⁡(πaf)πaf=a sincπ(af).

Self convolution of the Rectangular function

File:Splines resulting from successive convolution of the unit Rect function.png
The unit Rectangular function (in which T=1) along with the piecewise defined splines that result from successive convolutions of the Rectangular function with itself.

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.[11]

A convolution of the discontinuous rectangular function with itself results in the triangular function, which is a continuous function:

rect(2t/T)⁡*rect(2t/T)⁡=tri(t/T)⁡={1+t,−T<t<01−t,0<t<T0otherwise

Self convolution of the rectangular function applied twice yields a continuous and differentiably continuous parabolic spline:

rect(2t/T)⁡*rect(2t/T)⁡*rect(2t/T)⁡=tri(t/T)⁡*rect(2t/T)⁡={98+32t+12t2,−32T<t<−12T34−t2,−12T<t<12T98−32t+12t2,12T<t<32T0otherwise

A self convolution of the rectangular function applied three times yields a continuous, and a second order differentiably continuous cubic spline:

tri(t/T)⁡*tri(t/T)⁡={43+2t+t2+16t3,−2T<t<−T23−t2−12t3,−T<t<023−t2+12t3,0<t<T43−2t+t2−16t3,T<t<2T0otherwise

A self convolution of the rectangular function applied four times yields a continuous, and a third order differentiably continuous 4th order spline:

4thorder spline={625384+12548t+2516t2+512t3+124t4,−52T<t<−32T5596−524t−54t2−56t3−16t4,−32T<t<−12T115192−58t2+14t4,−12T<t<12T5596+524t−54t2+56t3−16t4,12T<t<32T625384−12548t+2516t2−512t3+124t4,32T<t<52T0otherwise


Since the Fourier Transform of the Rectangular function is the Sinc function, the Convolution theorem mean that the Fourier transform of pulses resulting from successive convolution 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 parabolic spline resulting from two successive convolutions of the Rectangular function with itself is Sinc3, etc.)

Use in probability

Script error: No such module "Labelled list hatnote". Viewing the rectangular function as a probability density function, it is a special case of the continuous uniform distribution with a=−1/2,b=1/2. The characteristic function is

φ(k)=sin⁡(k/2)k/2,

and its moment-generating function is

M(k)=sinh⁡(k/2)k/2,

where sinh⁡(t) is the hyperbolic sine function.

Rational approximation

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

Π(t)=limn→∞,n∈(Z)1(2t)2n+1.

Demonstration of validity

First, we consider the case where |t|<12. Notice that the term (2t)2n is always positive for integer n. However, 2t<1 and hence (2t)2n approaches zero for large n.

It follows that: limn→∞,n∈(Z)1(2t)2n+1=10+1=1,|t|<12.

Second, we consider the case where |t|>12. Notice that the term (2t)2n is always positive for integer n. However, 2t>1 and hence (2t)2n grows very large for large n.

It follows that: limn→∞,n∈(Z)1(2t)2n+1=1+∞+1=0,|t|>12.

Third, we consider the case where |t|=12. We may simply substitute in our equation:

limn→∞,n∈(Z)1(2t)2n+1=limn→∞,n∈(Z)112n+1=11+1=12.

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

rect⁡(t)=Π(t)=limn→∞,n∈(Z)1(2t)2n+1={0if |t|>1212if |t|=121if |t|<12.

Dirac delta function

The rectangle function can be used to represent the Dirac delta function δ(x).[12] Specifically,δ(x)=lima→01arect⁡(xa).For a function g(x), its average over the width a around 0 in the function domain is calculated as,

gavg(0)=1a∫−∞∞dx g(x)rect⁡(xa). To obtain g(0), the following limit is applied,

g(0)=lima→01a∫−∞∞dx g(x)rect⁡(xa) and this can be written in terms of the Dirac delta function as, g(0)=∫−∞∞dx g(x)δ(x).The Fourier transform of the Dirac delta function δ(t) is

δ(f)=∫−∞∞δ(t)⋅e−i2πftdt=lima→01a∫−∞∞rect⁡(ta)⋅e−i2πftdt=lima→0sinc⁡(af). where the sinc function here is the normalized sinc function. Because the first zero of the sinc function is at f=1/a and a goes to infinity, the Fourier transform of δ(t) is

δ(f)=1, 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

<templatestyles src="Reflist/styles.css" />

  1. ↑ Script error: No such module "citation/CS1".
  2. ↑ a b Script error: No such module "Template wrapper".
  3. ↑ Script error: No such module "citation/CS1".
  4. ↑ Script error: No such module "citation/CS1".
  5. ↑ Script error: No such module "citation/CS1".
  6. ↑ Script error: No such module "Citation/CS1".
  7. ↑ Script error: No such module "citation/CS1".
  8. ↑ Script error: No such module "citation/CS1".
  9. ↑ Script error: No such module "citation/CS1".
  10. ↑ Wolfram MathWorld, https://mathworld.wolfram.com/SincFunction.html
  11. ↑ Script error: No such module "citation/CS1".
  12. ↑ Script error: No such module "citation/CS1".

Script error: No such module "Check for unknown parameters".