# Calculating N-point DFT of a signal based on another signal's DFT

Now I would like to know a little bit more about expressing N-point DFT's of signals in terms of one another.

Having N-point DFT X(k) of a certain signal x(n), how can I calculate N-point DFT of a signal $$x_{s}=x(n)+(-1)^n \cdot{} x(n)$$ . Assuming $$N$$ is even.

Having thought about it a little bit, I came to a conclusion that we cancel half of the samples out and multiply the value of the rest of samples by a factor of 2. The spectrum will now have greater amplitude of peak but I am not sure how it will look like in terms of the location of frequency peak.

You just need to apply the formula consistently to see what's happening. Noting that $$(-1)^n=e^{-j\pi n}$$ you get for the DFT of $$x[n](-1)^n$$

\begin{align}\sum_{n=0}^{N-1}x[n](-1)^ne^{-j2\pi nk/N}&=\sum_{n=0}^{N-1}x[n]e^{-j\pi n}e^{-j2\pi nk/N}\\&=\sum_{n=0}^{N-1}x[n]e^{-j2\pi n(k+N/2)/N}\\&=X[k+N/2]\tag{1}\end{align}

where $$X[k]$$ is the DFT of $$x[n]$$, and where I've assumed that $$N$$ is even. Consequently, the DFT of $$x[n]+(-1)^nx[n]$$ is given by

\begin{align}\text{DFT}\{x[n]+(-1)^nx[n]\}&=\text{DFT}\{x[n]\}+\text{DFT}\{(-1)^nx[n]\}\\&=X[k]+X[k+N/2]\tag{2}\end{align}

where the index $$k+N/2$$ has to be taken modulo $$N$$ if $$X[k]$$ is defined for $$k\in[0,N-1]$$.

Let $$x[n]$$ be a sequence of length $$N$$ even, whose DTFT is $$X(e^{j \omega})$$ and the DFT is $$X[k]$$ which is given by the frequency sampling relation $$X[k] = X(e^{j \frac{ 2 \pi }{N} k}) ,$$ for $$k=0,1,2,...,N-1$$.

It can be shown that the DTFT of the new seqeunce is: $$y[n] = (-1)^n x[n] = e^{j \pi n} ~x[n] \longleftrightarrow Y(e^{j \omega}) = X(e^{j (\omega - \pi)})$$

and the DFT of $$y[n]$$ is: $$Y[k] = Y(e^{j \frac{ 2 \pi }{N} k}) = X(e^{j (\frac{ 2 \pi }{N}k - \pi)})=X(e^{j \frac{ 2 \pi }{N}(k - N/2)}) = X[k-N/2]$$

Since you look for DFT of $$z[n] = x[n] + y[n]$$, you get it from its DTFT : $$Z(e^{j \omega}) = X(e^{j \omega}) + Y(e^{j \omega})$$

Then the DFT of $$z[n]$$ is

$$Z[k] = Z(e^{j \frac{ 2 \pi }{N} k}) = X[k] + X[k-N/2]$$, for $$k=0,1,2,...,N-1.$$

Note that you can treat DFT $$Z[k]$$ as a periodic sequence, or use a modulus $$N$$ in its argument to find those values $$k-N/2$$.

• Why not apply duality to the above derivation to get the answer that you found so laboriously (in my opinion) in an earlier answer? There, alternate $X[k]$ were zero and the others doubled, and you derived $y[k] = x[k] + x[k+N/2]$ via a much more complicated argument involving down sampling and up sampling.... Here, alternate $x[k]$ are zero and the others doubled and you show that $Z[k]=X[k]+X[k+N.2]$ which is the dual result. – Dilip Sarwate Dec 2 '18 at 23:48
• @DilipSarwate I introduced duality, when I don't have the direct result but already have the dual result avalable. Here I think, the direct approach is much simpler to concieve as it only uses a readily avalable DFT modulation property. But as you said, yes, duality could also be used to conclude the same result. Indeed it could be an elegand complement to the direct solution. Yet, probably, the simplicity of the problem prevented me from thinking of alternate solutions... – Fat32 Dec 3 '18 at 0:56