Skip to content

Commit

Permalink
Fixed triangular window for multidimensional.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankong committed Jul 22, 2018
1 parent b262c97 commit 09ed7c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sigpy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def triang(shape, dtype=np.complex, device=cpu_device):
xp = device.xp

with device:
window = 1
window = ones(shape, dtype=dtype, device=device)
for n, i in enumerate(shape[::-1]):
w = 1 - xp.abs(xp.arange(i, dtype=dtype) - i // 2 + ((i + 1) % 2) / 2) / ((i + 1) // 2)
window *= w.reshape([i] + [1] * n)
Expand Down

0 comments on commit 09ed7c1

Please sign in to comment.