# Is it correct to assume that $(-1)^n = \cos(\pi n)$ while computing the DTFT of $(-1)^n$?

$$\cos(\pi n)$$ fluctuates between $$-1$$ and $$1$$ depending on the values of $$n$$, and it would be the same as computing it with an exponential but the problem is that I just get part of the right answer...

• can you share the real problem instead of asking if a simple equation $(-1)^n = \cos (\pi n)$ is correct ? – Ahmad Bazzi Jul 22 '19 at 11:51

$$(-1)^n = \cos(n\pi)=(e^{j\pi})^n=(e^{-j\pi})^n=e^{j\pi n} = e^{-j\pi n}$$

All of these would work. However, applying a DFT is bit tricky since it's directly at the Nyquist frequency and it technically violates the sampling theorem. You can certainly do the math but interpreting the result is not straightforward. For example if you phase shift $$\cos(n\pi)$$ to $$\sin(n\pi)$$ the magnitude of the FFT drops to zero, although you only time-shifted the signal.