# Finding the discrete time fourier coefficients to this problem

I'm trying to find the fourier series to this discrete time signal.

$$x_1[n] =\begin{cases} +\frac72&\text{if }0\le n \le 4\\ -\frac72&\text{if }5\le n \le 9 \end{cases}$$

My approach: We see that the discrete period, $$N$$, is 10, so $$\Omega_0 = \frac{2\pi}{10} = \frac{\pi}{5}$$

Now using the formula to get the DT fourier coefficients, $$X[k]$$

\begin{align} X[k] &= \frac{1}{N}\sum_{n = 0}^{n = 9}x_1[n]e^{-j\frac{\pi}{5}kn} \tag{1}\\ &= \frac{1}{10}\left( \sum_{n = 0}^{n = 4}\frac{7}{2}e^{-j\frac{\pi}{5}kn} + \sum_{n = 5}^{n = 9}\frac{-7}{2}e^{-j\frac{\pi}{5}kn} \right)\tag{2}\\ &= \frac{7j}{10}\sum_{n = 0}^{n = 4}\sin\left(\frac{\pi k n}{5}\right)\tag{3} \end{align}

However according to the solutions for $$k = 2$$, we have $$X[k = 2] = 0$$, but when I substitute $$kk = 2$$ into the final form of the above expression, I don't get $$0$$. Thus, my answer must be wrong, but I'm not sure where I went wrong... Can someone please explain where my math is flawed and if there's an easier way to find the coefficients?

• Your Eq-1 is wrong by convention; it should not have (1/N). Eq-2 is ok, Eq.3 is wrong :how did you merge the sum in Eq-2 ? Eq-4 is also wrong, it's missing a "k" term in the numerator, also it's based on an already wrong Eq-3... Eq.4 is still wrong apart from added "k" term. – Fat32 Feb 1 at 22:26
• @Fat32 Thanks for response! I think I changed it beyond equation 3, but I'm still not seeing how $X[k = 2] = 0$. Is there some identity I'm not using?  Also why is it convention to not write $\frac{1}{N}$ in the coefficients formula. Otherwise we end up with an amplitude of N times what we want for each sinusoid that makes up the signal... right? – BigBear Feb 1 at 22:43

$$\sum_{n=5}^9e^{-j\pi kn/5}=\sum_{n=0}^4e^{-j\pi k(n+5)/5}=\sum_{n=0}^4e^{-j\pi kn/5}e^{-j\pi k}=(-1)^k\sum_{n=0}^4e^{-j\pi kn/5}$$