Skip to content
Surf Wiki
Save to docs
general/special-functions

From Surf Wiki (app.surf) — the open knowledge base

Rectangular function

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

Rectangular function

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

Rectangular function with <math display=&quot;inline&quot;>T = 1</math>

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

\operatorname{rect}\left(\frac{t}{T}\right) = \Pi\left(\frac{t}{T}\right) = \left{\begin{array}{rl} 0, & \text{if } |t| \frac{T}{2} \ \frac{1}{2}, & \text{if } |t| = \frac{T}{2} \ 1, & \text{if } |t| \end{array}\right.

Alternative definitions of the function define \operatorname{rect}\left(t=\pm\frac{T}{2}\right) to be 0, 1, or undefined. The area under the curve does not change for the different definitions of the functions at t=\pm\frac{T}{2}.

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

History

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.

Relation to the boxcar function

The rectangular function is a special case of the more general boxcar function:

\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)

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

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

The unitary Fourier transforms of the rectangular function are \int_{-\infty}^\infty \operatorname{rect}(t)\cdot e^{-i 2\pi f t} , dt =\frac{\sin(\pi f)}{\pi f} = \operatorname{sinc}(\pi f) =\operatorname{sinc}\pi(f), using ordinary frequency f, where \operatorname{sinc}\pi is the normalized form of the sinc function and \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}} \cdot \operatorname{sinc}\left(\omega/2 \right), using angular frequency \omega, where \operatorname{sinc} is the unnormalized form of the sinc function.

For \operatorname{rect} (x/a), its Fourier transform is\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)}.

Self 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:

\begin{align} \operatorname{rect(2t/T)} * \operatorname{rect(2t/T)} = \operatorname{tri(t/T)} = \begin{cases} 1 + t, & -T 1 - t, & ,,,,, 0 0 & ,,,,,\text{otherwise} \ \end{cases} \end{align}

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

\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 \frac{3}{4} - t^2, & -\frac{1}{2}T \frac{9}{8} - \frac{3}{2}t + \frac{1}{2}t^2, & ,,,,, \frac{1}{2}T 0 & ,,,,,\text{otherwise} \ \end{cases} \end{align}

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

\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
\frac{2}{3} - t^2 - \frac{1}{2}t^3, & -T \frac{2}{3} - t^2 + \frac{1}{2}t^3, & ,,,,,0 \frac{4}{3} - {2}t + t^2 -\frac{1}{6}t^3 , & ,,,,,T
0 & ,,,,,\text{otherwise} \ \end{cases} \end{align}

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

\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
\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

\frac{115}{192} - \frac{5}{8}t^2 + \frac{1}{4}t^4, & -\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 \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

0 & ,,,,,\text{otherwise} \ \end{cases} \end{align}

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

Main article: Uniform distribution (continuous)

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

\varphi(k) = \frac{\sin(k/2)}{k/2},

and its moment-generating function is

M(k) = \frac{\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:

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

Demonstration of validity

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

It follows that: \lim_{n\rightarrow \infty, n\in \mathbb(Z)} \frac{1}{(2t)^{2n}+1} = \frac{1}{0+1} = 1, |t|

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

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

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

\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}.

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

\operatorname{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| \end{cases}

Dirac delta function

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

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

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

\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)}. 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 \delta (t) is

\delta (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.

References

References

  1. Wolfram Research. (2008). "HeavisidePi, Wolfram Language function".
  2. "Rectangle Function".
  3. Wang, Ruye. (2012). "Introduction to Orthogonal Transforms: With Applications in Data Processing and Analysis". Cambridge University Press.
  4. Tang, K. T.. (2007). "Mathematical Methods for Engineers and Scientists: Fourier analysis, partial differential equations and variational models". Springer.
  5. Kumar, A. Anand. (2011). "Signals and Systems". PHI Learning Pvt. Ltd..
  6. Klauder, John R. (1960). "The Theory and Design of Chirp Radars". Bell System Technical Journal.
  7. Woodward, Philipp M. (1953). "Probability and Information Theory, with Applications to Radar". Pergamon Press.
  8. Higgins, John Rowland. (1996). "Sampling Theory in Fourier and Signal Analysis: Foundations". Oxford University Press Inc..
  9. Zayed, Ahmed I. (1996). "Handbook of Function and Generalized Function Transformations". CRC Press.
  10. Wolfram MathWorld, https://mathworld.wolfram.com/SincFunction.html
  11. Spooner, Chad. (January 28, 2021). "SPTK: Convolution and the Convolution Theorem".
  12. (2023). "Fourier Optics and Computational Imaging". Springer.
Info: Wikipedia Source

This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.

Want to explore this topic further?

Ask Mako anything about Rectangular function — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report