Reference articles on history, science, culture and more
Encyclopedia

Boxcar function

Mathematical function resembling a boxcar

Image credit is listed at the end of this article.

In mathematics, a boxcar function is any function which is zero over the entire real line except for a single interval where it is equal to a constant A. The function is named after its graph's resemblance to a boxcar, a type of railroad car. The boxcar function can be expressed in terms of the uniform distribution as

\operatorname {boxcar} (x)=(b-a)A\,f(a,b;x)=A(H(x-a)-H(x-b)),

where f(a,b;x) is the uniform distribution of x for the interval [a,b] and H(x) is the Heaviside step function. As with most such discontinuous functions, there is a question of the value at the transition points, which are usually best chosen depending on the individual application.

When a boxcar function is selected as the impulse response of a filter, the result is a simple moving average filter, whose frequency response is a sinc-in-frequency, a type of low-pass filter.

Watch videos about Boxcar functionExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Boxcar function, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Images, from Wikimedia Commons:

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.

Continue exploring

Related topics

Boxcar averager

A boxcar averager, gated integrator or boxcar integrator is an electronic test instrument that integrates the signal input voltage after a defined waiting time over a specified period of time (gate width) and then averages over multiple integration results (samples), for a mathematical description see boxcar function. The main purpose of this measurement technique is to improve signal to noise ratio in pulsed experiments with often low duty cycle by the following three mechanisms: 1) signal integration acts as a first averaging step that strongly suppresses noise components with a frequency of the reciprocal gate width and higher, 2) time-domain based selection of signal parts that actually carry information of interest and neglect of all signal parts where only noise is present, and 3) averaging over a defined number of periods provides low-pass filtering and convenient adjustment of time resolution.

Rectangular function

The rectangular function is defined as rect ⁡ ( t T ) = Π ( t T ) = { 0 , if | t | > T 2 1 2 , if | t | = T 2 1 , if | t | < T 2 . {\displaystyle \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|<{\frac {T}{2}}.\end{array}}\right.} Alternative definitions of the function define rect ⁡ ( t = ± T 2 ) {\textstyle \operatorname {rect} \left(t=\pm {\frac {T}{2}}\right)} to be 0, 1, or undefined.

Step function

In mathematics, a function on the real numbers is called a step function if it can be written as a finite linear combination of indicator functions of intervals. Informally speaking, a step function is a piecewise constant function having only finitely many pieces.