Plot of a DTFT is not periodic From this impulse response:

$$h[n]=a^n u[n]\quad\text{with}\quad\lvert a\rvert&lt;1$$

Applying DTFT analysis equation I obtain this frequency response:

$$H(e^{j\omega})=\dfrac{1}{1-ae^{-j\omega}}$$

But when I plot $\mathrm{abs}[H(e^{j\omega})]$ with MATLAB I obtain something that is a-periodic:

What I am doing wrong? This is my code:

W = [-4*pi:0.1:4*pi];
a = 0.9;
H = 1.0./(1.0-e*a.^(-j*W));
plot(W,abs(H));
You switched the $a$ and $e$ in your third line of code. If you write it like this, then it will be behave as expected:

H = 1.0./(1.0-a*exp(-j*W));