How to compute $$\sum_{j=1}^{K}\frac{P(j)}{Q(j)}\exp(2\pi ija) $$ where $\left|a\right|<1,\ K\in Z$,$\frac{P(j)}{Q(j)}$-rational function.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}$$