I am wondering which one is correct approach.
Let me have an equation, $x[n] = \delta[n-m]$.
If I try to calculate its DTFT(Discrete Time Fourier Transform) as below,
$$ X(e^{j\omega}) = \sum_{n=-\infty}^{\infty} \delta[n-m]e^{-j\omega n}. $$
Whatever $n$ or $m$ because dirac delta function is 1 when $n=m$.
So I think $X(e^{j\omega})=1$.
However, if I substitute $n-m = t$, $n$ is equal to $t+m$.
And then above equation can be converted as below,
$$ X(e^{j\omega}) = \sum_{t=-\infty}^{\infty} \delta[t]e^{-j\omega (t+m)}. $$
In this case $X(e^{j\omega})$, therefore, is equal to $e^{-j\omega m}$.
Which one is correct, and if there is a mistake between two answers,
please let me know where is incorrect.
Thank you in advance.
Best Answer
The second one is correct (up to a typo, you want $X(e^{j\omega}) = e^{-j\omega m}$; no $n$ in the second part).
For your first one, note that - as you write - $$ \delta[n-m] = \begin{cases} 0 & n \ne m \\ 1 & n = m \end{cases} $$ Hence (only the summand where $n=m$ survives) \begin{align*} X(e^{j\omega}) &= \sum_{n=-\infty}^\infty \delta[n-m] e^{-j\omega n}\\ &= e^{-j\omega n}|_{n=m}\\ &= e^{-j\omega m} \end{align*}