8
$\begingroup$

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.

$\endgroup$
4
  • 2
    $\begingroup$ Since 'a' could be negative, that UnitStep factor is appropriate. To be rid of it add Assumptions->a>0 to the FT. $\endgroup$ Sep 12, 2012 at 15:08
  • $\begingroup$ Thanks, I added that and the result now look like this: (2 Sin[(a k)/2])/k $\endgroup$
    – fiz
    Sep 12, 2012 at 15:31
  • $\begingroup$ 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). $\endgroup$ Sep 12, 2012 at 15:44
  • $\begingroup$ Reduce[(2 Sin[(a k)/2])/k == Sinc[a*k/2]/a] $\endgroup$ Sep 12, 2012 at 15:57

2 Answers 2

12
$\begingroup$

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

PiecewiseExpand[UnitBox[x]]

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

$\endgroup$
1
  • $\begingroup$ nice, I didn't know about UnitBox... I've always defined my own rect function with the above piecewise definition $\endgroup$
    – rm -rf
    Sep 13, 2012 at 15:57
8
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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