r+1)/2;

<span class="comment">% over-sampling factor</span>
mult_factor = 30;        <span class="comment">% should have mult_factor*(n) &gt;&gt; n</span>
m = mult_factor*n;

<span class="comment">% computation method:</span>
<span class="comment">% H(exp(jTw)) = alpha(w) + j*phi(w)</span>
<span class="comment">% where alpha(w) = 1/2*ln(R(w)) and phi(w) = Hilbert_trans(alpha(w))</span>

<span class="comment">% compute 1/2*ln(R(w))</span>
w = 2*pi*[0:m-1]/m;
R = exp( -j*kron(w',[-(n-1):n-1]) )*r;
R = abs(re