I want to calculate the closed-form analytical expression for DFT coefficients of the following problem

$$x[n]=\left\{ \begin{array}{ll} 1 & \mbox{if } 0\leq n \leq M-1 \\ 0 & \mbox{if }M \leq n \leq L-1 \end{array} \right.$$ Write out the closed-form analityical expression for its DFT coefficients $X[k]$.

I always get the wrong solution... My attempted solution is: $$\frac{1 - e^{-j\pi k \frac{M}{L}} }{ 1 - e^{-j\pi k \frac{1}{L}} }$$

What is the correct solution and why?


2 Answers 2


The DFT of a vector of size L is L samples of the Fourier transform of the signal:

$$ X[k] = X(e^{j\theta})|_{\theta = 2\pi k/L} $$

So now we need to calculate the FT of $x[n]$:

$$ X(e^{j\theta}) = \sum_{n=0}^{n=M-1} e^{-j n \theta} $$

This is a geometric series which results in:

$$ X(e^{j\theta}) = \frac{1 - e^{-jM\theta}}{1 - e^{-j\theta}} $$

Evaluate on the DFT samples to give:

$$ X[k] = \frac{1 - e^{-j M 2 \pi k/L}}{1 - e^{-j 2 \pi k / L}} $$

You can extract half phase from top and bottom to give:

$$ X[k] = e^{-j(M-1)\pi k/L} \frac{\sin(M \pi k/L)}{\sin(\pi k/L)} $$

  • $\begingroup$ E^(-j*(M-1)*pik/L)*sin(Mpik/L)/sin(pik/L) $\endgroup$ May 23, 2020 at 17:41

As per my analysis, the answer should be enter image description here

I used the DFT formula for a discrete sequence enter image description here

I integrated the above in two parts.

First from n=0 to M-1


Second from n=M to L-1

As per the given conditions the xn will be zero for the second part

This reduces to a geometric series

enter image description here





and $$n=M-1$$

  • 1
    $\begingroup$ welcome to the DSP SE, Sau001. in the future, it would be better to do all of your equations with $\LaTeX$. $\endgroup$ Jun 20, 2021 at 23:58
  • $\begingroup$ @robertbristow-johnson Absolutely! Still learning LatEx. $\endgroup$
    – Sau001
    Jun 21, 2021 at 8:20

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.