In a course i'm currently taking, the lecturer computed DTFT for the following signal: $$r[n] = \begin{cases} 1& 0 \le n \le N\\ 0& \mbox{otherwise} \end{cases} $$ For $N = 32$ i pictured $\frac{1}{N}\frac{\sin{\omega*N/2}}{\sin{\omega/2}}$:
The lecturer told us that you can compute DTFT of any signal on finite support by using this formula:
\begin{align*} \bar{X}(e^{j\omega}) = \sum_{k=0}^{N-1}X[k]\bar{R}(e^{\omega - \frac{2\pi}{N} k})\\ \end{align*}
So, I tried to render DTFT of sawtooth (red) as the sum:
That's clearly wrong. What did I do wrong?