I want to evaluate fourier transform within a certain limit in MATLAB,the expression of which is

$$X(f) = \int_{1}^{4}{x(t)e^{-i2\pi ft}}\,dt$$

I have to find value of the above expression within limits which are definite in nature.

I came across this post on MATLAB discussion forum which says to multiply the function by dirac(x-lowerbound) * dirac(upperbound-x) and then use fourier to calculate the desired results,but i am not getting the desired results.
What else can I try?


  • 2
    $\begingroup$ Welcome to DSP. I have troubles understanding your question: do you want to compute the continuous Fourier transform of some $x$ (your formula) or to evaluate it (approximation) withing bounds? $\endgroup$ Commented May 30, 2019 at 11:41
  • $\begingroup$ It might help if you just explicitly wrote down what you're looking for, like "I'm looking for $X(f)$ for $f \in [\text{lowerbound};\text{upperbound}]$, or whatever you mean. I'm just as confused as Laurent. $\endgroup$ Commented May 30, 2019 at 12:16
  • $\begingroup$ @MarcusMüller,@LaurentDuval sorry for being unclear .I have edited the question.I want to calculate the fourier transform within bounds. $\endgroup$
    – nebulla
    Commented May 30, 2019 at 14:51

1 Answer 1


So, your integral with bounds

$$X(f) = \int_{a}^b x(t) e^{-i2\pi ft}\,dt$$

could really be written as

$$X(f) = \int_{-\infty}^\infty (r_{a,b}(t)\cdot x(t)) e^{-i2\pi ft}\,dt$$

with $r_{a,b}(t) = \begin{cases}1 & a<t\le b\\0&\text{else,}\end{cases}$ i.e. as a "windowed" view at $x(t)$.

Luckily, the convolution theorem of the Fourier transform allows us to say that

$$\mathcal F\{r_{a,b}\cdot x\} = \mathcal F\{r_{a,b}\}*F\{x\}$$ with $*$ being the convolution operator.

Thus, you'd just need to numerically determine an estimate for the Fourier transform of $x$, $F\{x\}$, and convolve that with the Fourier transform of your window $r$. Luckily, the Fourier transform of a unity-wide rectangle is known (it's a sinc function), and you just need to apply the scale and shift theorems of the Fourier transform to convert that standard sinc to the Fourier transform $F\{r_{a,b}\}$.

Then you'd need to estimate the convolution of the two.

Assuming your signal is well-behaved (especially: band-limited), a discretized signal $x[n]$ represents your $x(t)$, and hence, you could estimate the continuous time Fourier Transform within the signal bandwidth by doing a DFT (matlab: fft()) of sufficient samples of a period of $x(t)$.

As said, finding $F\{r_{a,b}\}$ is easy to do analytically. Simply generate the same amount of samples of $F\{r_{a,b}\}$ as you did for $x(t)$, and numerically convolve the result (matlab: convolve, filter).

This might be much more effort or much less elegant or much less accurate than simply doing numeric integration, which matlab can also do out of the box. But I'm assuming you're not interested in that, because a) it's trivial to find "matlab numerical integration" if you just look for it, so I presume you already did that and b) I'm assuming you're asking how to solve this with signal processing methods, considering the place you ask.

  • $\begingroup$ I was so engrossed in dsp that i didn't thought that simple numerical integration can solve it in matlab. Sorry for this as this didn't came in my mind.I had done above integration using simple integration in matlab and it worked. $\endgroup$
    – nebulla
    Commented May 31, 2019 at 6:13

Your Answer

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

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