# Finding the correct $x[n]$ from a given DFT $x[k]$ [closed]

I'm struggling to solve this question from an exam. The question gives you a set of IDFTs from a given DFT, only one of those is the correct.

The first thing I did is notice that $2\sin(\pi k)$ will always be zero for every $k$ so I ignore it.

Then I proceed to do the IDFT with the rest as $x[n] = x[k]e^{2j(2 \pi /N)n}$

And there is where i get lost and confused cause i know that the cos can be expressed in the Euler form and also:

l -> lambda;   cos(wn) = l[n-m] + l[n+m] <- Modulation.


So, when i see the given answers... i think i am missing something.

Thanks for your time.

## closed as unclear what you're asking by Laurent Duval, A_A, lennon310, Peter K.♦Jan 22 '18 at 12:39

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Thanks for the edit! I was reading some Latex right now. – WhiteGlove Jan 20 '18 at 17:54

Let's solve the exercise. It's asking for your awareness of periodicity in DFT and some trigonometry.

First, beacuse of the question content, let's state the following : $$\delta[n-d] \overset{DTFT} \longleftrightarrow e^{-j \omega d } \overset{DFT} \longleftrightarrow e^{-j \frac{2 \pi}{N} d k }$$

Then given our DFT $X[k]$ work it backwards into $x[n]$ as a sum of delayed impulses.

\begin{align} X[k] &= 2 \cos(\frac{\pi k}{2}) + 2 \sin(\frac{14 \pi k}{8}) + \sin(\pi k) \\ X[k] &= 2 \cos(\frac{\pi k}{2}) + 2 \sin( \left( 2\pi - \frac{2\pi}{8} \right) k) + 0 \\ X[k] &= 2 \cos(\frac{\pi k}{2}) + 2 \sin(- \frac{2\pi}{8} k) \\ X[k] &= 2 \cos(\frac{\pi k}{2}) - 2\sin(\frac{\pi}{4} k) \\ \end{align}

We have used basic trigonometry to reach the above line. Now lets use Euler's formula to expand the cosines and sines into complex exponentials so that we can use the corresponence of the first line to deduce the time domain impulses.

\begin{align} X[k] &= 2 \cos(\frac{\pi k}{2}) - 2\sin(\frac{\pi}{4} k) \\ X[k] &= 2 \left( \frac{ e^{j \frac{\pi}{2} k} + e^{-j \frac{\pi}{2} k} }{2} \right) -2 \left( \frac{ e^{j \frac{\pi}{4} k} - e^{-j \frac{\pi}{4} k} }{2j} \right) \\ X[k] &= \left( e^{j \frac{\pi}{2} k} + e^{-j \frac{\pi}{2} k} \right) +j \left( e^{j \frac{\pi}{4} k} - e^{-j \frac{\pi}{4} k} \right) \\ \end{align}

Now the correspondence between $\delta[n-d]$ and its $N=8$ point DFT is: $$\delta[n-d] \overset{DTFT} \longleftrightarrow e^{-j \omega d } \overset{DFT} \longleftrightarrow e^{-j \frac{2 \pi}{8} d k } = e^{-j \frac{\pi}{4} d k }$$

And by using ths relationship we can deduce from the last line that the impulses are:

\begin{align} X[k] &= e^{j \frac{\pi}{2} k} + e^{-j \frac{\pi}{2} k} +j e^{j \frac{\pi}{4} k} - e^{-j \frac{\pi}{4} k} \\ x[n] &= \delta[n+2] + \delta[n-2] + j\delta[n+1] -j \delta[n-1] \end{align}

One last step remains to complete the answer; representation of $x[n]$ in the range $0 \leq n \leq 7$ as it is the valid range for the formal relationship between $x[n]$ and its $N$-point DFT $X[k]$. Then we should map those impulses outisde of this range into it. As you can see $\delta[n+1]$ and $\delta[n+2]$ are outside of this range and should be mapped into $0 \leq n \leq 7$ by shifting them right by $N=8$. This shift is the consequence of the inherent periodicity in both $x[n]$ and $X[k]$ as $x[n-N] = x[n]$ etc. So we decude that $x[n]$ in the range $0 \leq n \leq 7$ is:

$$x[n] = \delta[n+2-8] + \delta[n-2] + j\delta[n+1-8] -j \delta[n-1]$$ $$x[n] = \delta[n-6] + \delta[n-2] + j\delta[n-7] -j \delta[n-1]$$

which is shown in the option b.

• When you explain the X[k] as delayed impulses. You delay them because the periodicity, which is 2pi, right? – WhiteGlove Jan 20 '18 at 20:50
• Also, where does 14pi/16 comes from? 1/2pi? – WhiteGlove Jan 20 '18 at 20:51
• @WhiteGlove X[k] is not delayed impulses. It's complex exponentials. x[n] is delayed impulses. Also for $14\pi/16$ ! You are right! it was a typo. I'm sorry. Now let me correct it. Nevertheless it doesnt affect the result (because it was a typo, in the next line I used the correct value as $14 \pi /8$as you can see :-)) – Fat32 Jan 20 '18 at 23:26

I got option (b), like Fat32, but I arrived at it with a different line of reasoning and not employing the DTFT.

First recognize that the DFT and iDFT behave the same way. The only difference is the sign of the exponent and the normalization factors used. In this problem they used the words "corresponde con" instead of "es" so the normalization factor is not an issue.

Second, for real signals, bin values come in conjugate pairs.

Your observation about $\sin( \pi k )$ is correct.

As a signal, $\cos( \frac{\pi k}{2} ) = \cos( 2 \frac{2\pi k}{8} )$ would have a real value in bin 2 and its complex conjugate, also real (thus the same), at bin 6 (=8-2).

As a signal, $\sin( \frac{14\pi k}{8} ) = \sin( 7 \frac{2\pi k}{8} )$ is above the Nyquist frequency, but is still bin 7. Its complex conjugate is at bin 1 (=8-7), and since it would be imaginary, the negative value.

Out of the answers, (b) provides for bin 2 and bin 6 having the same real value, and bin 1 and bin 7 having opposite signed imaginary values.

Now, interpret the "bins" as signal values since you are doing the inverse.

Hope this helps.

Ced

• Sorry but can you specify a bit what do you mean by "bin"? – WhiteGlove Jan 20 '18 at 20:47
• @WhiteGlove, yes, a "bin" is simply a name for a DFT value. "X[k]" is called the "kth bin". The DFT takes signal values and gives you bin values. The iDFT takes bin values and gives you signal values. – Cedron Dawg Jan 20 '18 at 22:12
• Thank you very much, as you can see, i am learning it in Spanish so every "English term" costs me a bit to understand. I see it kind of an index inside an array (like in programming) – WhiteGlove Jan 20 '18 at 23:22
• De nada. It is very much like an array in programming. It can also be considered as a Nx1 matrix in math, and taking a DFT is just a matrix multiplication – Cedron Dawg Jan 21 '18 at 1:02
• (continued): X = Fx, where F is a NxN matrix where each element is defined as $e^{-jrc\frac{2\pi}{N}}$ and r,c are the row an column. Check out my blog article DSPRelated.com/showarticle/768.php for a different graphical way of understanding the DFT. – Cedron Dawg Jan 21 '18 at 1:10