Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to obtain the form of a sinc function that I know I'm supposed to get in Mathematica. I'm doing this because I intend to do a lot with Fourier transforms (FT) and I'd like to know I'm not missing constants or something of the like.

For example, consider: $$ f(x) = \begin{cases} A && -\frac{a}{2} ≤ x ≤ \frac{a}{2}\\ 0 && \text{otherwise}\\ \end{cases}$$

Employing the following:

FourierTransform[UnitStep[a/2 + x] UnitStep[a/2 - x], x, k, FourierParameters -> {1, -1}]

It gives: (2 Sin[(a k)/2] UnitStep[a])/k

Is this Mathematica's way of giving the sinc function? I guess I was expecting something more like (2 Sin[(a k)/2])/(k a). I know there are different parameters that can be used, but none of them have given the form I was expecting.

When I try to do the FT directly as an integral:

Integrate[A Exp[-I k x], {k, -a/2, a/2}]

It gives: (2 A Sin[(a x)/2])/x

Are these the same? I was expecting something that would lead to $\rm{sinc}[k a/2]$. I have not found previous questions that can help, and the documentation in Mathematica (version 8) also has not helped either.

share|improve this question
Since 'a' could be negative, that UnitStep factor is appropriate. To be rid of it add Assumptions->a>0 to the FT. – Daniel Lichtblau Sep 12 '12 at 15:08
Thanks, I added that and the result now look like this: (2 Sin[(a k)/2])/k – fiz Sep 12 '12 at 15:31
That appears to be equivalent to Sinc[a*k/2]/a, which means it is probably fine (I am not willing to wade through the parameter specs to prove this though). – Daniel Lichtblau Sep 12 '12 at 15:44
Reduce[(2 Sin[(a k)/2])/k == Sinc[a*k/2]/a] – Dr. belisarius Sep 12 '12 at 15:57
up vote 11 down vote accepted

In Mathematica there is a designated function for this, UnitBox,


enter image description here

which gives expected result without assumptions:

FourierTransform[UnitBox[x/a], x, k, FourierParameters -> {1, -1}]

Abs[a] Sinc[(a k)/2]

There is actually a set of designated functions:

FourierTransform[UnitTriangle[x/a], x, t, FourierParameters -> {1, 1}]

Abs[a] Sinc[(a t)/2]^2

FourierSinCoefficient[#[x], x, n, FourierParameters -> {1, 2 Pi}] & /@ 
{TriangleWave, SawtoothWave, SquareWave}

enter image description here

share|improve this answer
nice, I didn't know about UnitBox... I've always defined my own rect function with the above piecewise definition – R. M. Sep 13 '12 at 15:57

There is no inconsistency here. If you assume a to be positive, as Daniel mentioned, you get the same answer:

FourierTransform[UnitStep[a/2 + x] UnitStep[a/2 - x], x, k, 
    FourierParameters -> {1, -1}, Assumptions -> a > 0]
(* (2 Sin[(a k)/2])/k *)

Integrate[UnitStep[a/2 + x] UnitStep[a/2 - x] Exp[-I k x], 
    {x, -∞, ∞}, Assumptions -> a > 0]
(* (2 Sin[(a k)/2])/k *)

Note that:

$$ \frac{2\sin(a k/2)}{k} = \frac{a \sin (ak/2)}{ak/2} = a \text{sinc}(ak/2)$$

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.