Ideal high pass filter for discrete signal there. I currently get stuck on a question. I was asking to find an inverse discrete-time Fourier transform for the ideal high pass filter.
Here is the question 
It is getting more confused after I read the second solution of this post
How to produce a high-pass filter from a low-pass one?
It tends out I can either calculate it by time-shifting property

Or I can calculate it through the definition

But they lead to a different result. My textbook solution said the second one is correct. But I cannot find any problem with the first one.
If we assume $\ 0 \le n &lt; N-1$ for $h[n]$, using N = 61, $\alpha =30$, cutoff analog frequency $=1500Hz$.
(Assume the sampling rate $=44100 Hz$ )
I got these two graphs:
(for first solution)
and

(for the second)
Here are my codes

I really don't know why they lead to different results.
HINT: Your original LPF is $-\omega_c \lt \omega \lt +\omega_c$. When you shift it by $\pi$, your integral limit for second method is $\int_{-\pi}^{-\pi + \omega_c}$ and $\int_{\pi - \omega_c}^{\pi}$.

For the first method, it should be
$$
h[n] = (-1)^{(n-\alpha)}\frac{sin(\omega_c(n-\alpha))}{\pi(n-\alpha)}
$$
because you have to apply shift of $\alpha$ on $n$. This will fix your plot of (1). 

For (2), with the changed limits as I hinted at the beginning
$$
h[n] = \frac{1}{2\pi}\int_{-\pi}^{-\pi + \omega_c}e^{-j\alpha\omega}e^{j\omega n}d\omega + \frac{1}{2\pi}\int_{\pi-\omega_c}^{\pi}e^{-j\alpha\omega}e^{j\omega n}d\omega\\
= \frac{1}{2\pi j(n-\alpha)}[e^{-j(n-\alpha)(-\pi+\omega_c)} - e^{j(n-\alpha)(-\pi)}] +\frac{1}{2\pi j(n-\alpha)}[e^{-j(n-\alpha)(\pi)} - e^{-j(n-\alpha)(\pi-\omega_c)}] \\
= \frac{1}{2\pi j(n-\alpha)}e^{-j(n-\alpha)(-\pi)}[e^{-j(n-\alpha)\omega_c} - 1]+\frac{1}{2\pi j(n-\alpha)}e^{-j(n-\alpha)(\pi)}[1 - e^{j(n-\alpha)\omega_c}]\\
= \frac{1}{2\pi j(n-\alpha)}(-1)^{(n-\alpha)}[e^{-j(n-\alpha)\omega_c} - e^{j(n-\alpha)\omega_c}]\\
= (-1)^{(n-\alpha)}\frac{sin(\omega_c(n-\alpha)}{\pi(n-\alpha)}
$$