# How to calculate DTFT of cosine function divided by n

I'm having a hard time to calculate the next function, and I don't really know Matlab good enough to calculate it there. Help would be appreciated:

$$h[n]=\frac{A_1 \cos⁡[\theta_1(n-N/2)]}{n-N/2}$$

• What is $N$? And is $h[n]$ defined for $-\infty<n<\infty$? Jul 22, 2020 at 16:18
• A1 = 59 ; N = 297; teta1 = 0.1*pi Jul 23, 2020 at 5:52
• Yes, but does $h[n]$ have finite length or is it defined for all $n$? Jul 23, 2020 at 6:25
• Its actually a part of calculating DTFT of FIR filter (this is the hd[n] which is multiplied with hamming window), but I wanted to see how does it look like in the frequency domain (DTFT domain). so yes, it is infinite in length. Jul 23, 2020 at 11:41
• But if $N$ is even, then $h[n]$ doesn't exist for $n=N/2$. Jul 23, 2020 at 12:01

The given impulse response is a scaled version of the impulse response of a highpass Hilbert transformer with delay $$\tau=N/2$$ ($$N$$ odd) with frequency response

$$H(e^{j\omega})=\begin{cases}-j\,\textrm{sgn}(\omega)\,e^{-j\omega\tau},&\omega_c<\omega<\pi\\j\,\textrm{sgn}(\omega)\,e^{-j\omega\tau},&-\pi<\omega<-\omega_c\\0,&-\omega_c<\omega<\omega_c\end{cases}\tag{1}$$

This can be shown as follows:

\begin{align}h[n]&=\frac{1}{2\pi}\int_{-\pi}^{\pi}H(e^{j\omega})e^{jn\omega }d\omega\\&=\frac{1}{2\pi}\left[-j\int_{\omega_c}^{\pi}e^{j\omega(n-\tau)}d\omega+j\int_{-\pi}^{-\omega_c}e^{j\omega(n-\tau)}d\omega\right]\\&=\frac{1}{2\pi (n-\tau)}\left[-e^{j\pi(n-\tau)}+e^{j\omega_c(n-\tau)}+e^{-j\omega_c(n-\tau)}-e^{-j\pi(n-\tau)}\right]\\&=\frac{\cos[\omega_c(n-\tau)]-\cos[\pi(n-\tau)]}{\pi(n-\tau)}\tag{2}\end{align}

Since for $$\tau=(2k+1)/2$$, $$k\in\mathbb{Z}$$, we have $$\cos[\pi(n-\tau)]=0$$ we arrive at the following inverse DTFT of $$(1)$$:

$$h[n]=\frac{\cos[\omega_c(n-\tau)]}{\pi(n-\tau)}\tag{3}$$

• Is there any chance of showing the DTFT (the forward way) of the function h[n]? I understood the IDTFT. Aug 27, 2020 at 17:48