# How to find the DTFT of unit step with $(-1)^n$ scalar multiplied?

What are the DTFTs of the following two signals?

$$x[n] = e^{j \pi n}\left\{u[n] - u[n-8]\right\}\quad\text{and}\quad h[n] = (-1)^n\left\{u[n] - u[n-4]\right\}$$

I am trying to find $X(\omega)$ and $H(\omega)$ and the scalar $(-1)^{n}$ is throwing me off.

• well, since there are only 8 (or 4) non-zero samples, this should be quite easy. – robert bristow-johnson Nov 21 '16 at 21:20

First note that $e^{j\pi n}=(-1)^n$. Furthermore, note that $u[n]-u[n-N]$ is a rectangular impulse of width $N$.
Now, you can calculate $$\textrm{DTFT}\left\{u[n]-u[n-N])\right\} = \sum_{n=0}^{N-1}e^{-j2\pi nf}=\frac{1-e^{-j2\pi Nf}}{1-e^{-j2\pi f}}$$ which is the rule for the geometric sum. Furthermore, you will find
$$\textrm{DTFT}\left\{\exp{(j\pi n)}\right\}=\delta\left(f-\frac{1}{2}\right)$$
$$\textrm{DTFT}\left\{\exp({j\pi n})(u[n]-u[n-N])\right\}=\delta\left(f-\frac{1}{2}\right)\star\frac{1-e^{-j2\pi Nf}}{1-e^{-j2\pi f}}=\frac{1-e^{-j2\pi N(f-\frac{1}{2})}}{1-e^{-j2\pi (f-\frac{1}{2})}}$$