if M[ii] < X: // if the number of time channels is too small, aliasing is introduced
col = ceil(float(X)/M[ii])
temp = N.zeros((M[ii],col),dtype=float)
temp[-floor(X/2.):,:ceil(X/2.)] = f[win_range]*fftshift(N.conj(g[ii]))
c.append(N.fft.ifft(N.sum(temp,axis=1)))
else:
temp = N.zeros((M[ii],1),dtype=float)
After Change
win_range = N.mod(pos,Ls+fill)
t = f[win_range]*fftshift(N.conj(g[ii]))
// TODO: the following indexes can be written as two slices
ixs = N.concatenate((N.arange(M[ii]-int(floor(X/2.)),M[ii]),N.arange(0,int(ceil(X/2.)))))
if M[ii] < X: // if the number of time channels is too small, aliasing is introduced
// TODO: branch not tested
col = ceil(float(X)/M[ii])
temp = N.zeros((M[ii],col),dtype=complex)
temp[ixs] = t
temp = N.sum(temp,axis=1)
else:
temp = N.zeros(M[ii],dtype=complex)