How to compute $\sum_{j=1}^{K}\frac{P(j)}{Q(j)}\exp(2\pi ija) $ where $\left|a\right|<1,\ K\in \mathbb{Z}$, $\frac{P(j)}{Q(j)}$ is a rational function and the roots $Q(j)$ are known, complex.$$$$
In my case $$Q(j)=(1+j^{2q})(j^{2p}+(j-A)^{2p})$$ with integer $q,p>0$ and real $A>=0$.
$$P(j)=(j-A)^{2p}$$ or $$P(j)=j^{2p}$$ or $$P(j)=j^{2}(j-A)^{2p}$$