I am trying to derive the impulse response $h[n]$ of an ideal high-pass filter in discrete time, whose desired frequency response is
$ H(e^{j\omega}) = \begin{cases} 1, & \tfrac{2\pi}{3} \le |\omega| \le \pi,\\ 0, & \text{otherwise}. \end{cases} $
I know that the direct approach using the inverse DTFT,
$ h[n] = \frac{1}{2\pi}\!\Bigl[\int_{2\pi/3}^{\pi} e^{j\omega n}\,d\omega \;+\; \int_{-\pi}^{-2\pi/3} e^{j\omega n}\,d\omega\Bigr], $ gives the well-known result
$ h[n] = \frac{(-1)^n}{\pi\,n}\,\sin\!\Bigl(\tfrac{\pi n}{3}\Bigr). $
However, I tried a different approach: I started with a low-pass rectangle of width $\pi/3$ and height 1 in the range $[0,\,\pi/3]$. Its inverse transform is $\tfrac{1}{3}\,\mathrm{sinc}(n/3)$. Then I “shifted” that rectangle to $\omega = +\pi$ and $\omega = -\pi$ (taking into account (2\pi)-periodicity).
When I sum those two time-domain signals, I end up with an extra factor of 2, i.e., something like
$ \frac{2}{3}\,\mathrm{sinc}\!\bigl(\tfrac{n}{3}\bigr)\,(-1)^n, $
instead of $\tfrac{1}{3}\,\mathrm{sinc}(n/3)\,(-1)^n$.
Why does this factor of 2 appear?
CHATGPT says that I should *1/2 but i have no clue why ?
Why adding two functions/rectangles into the one given function doesnt work ?
This is a simple issue what if i had triangles or what if the left rectangle was shifted more ?
The whole thing is not clear ,
Would appreciate some help
