Skip to content

Commit

Permalink
add N assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
waltsims committed Dec 19, 2023
1 parent ce938f6 commit 3c41b7a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kwave/utils/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def cosine_series(n: int, N: int, coeffs: List[float]) -> np.ndarray:
if N.size == 1:
n = np.arange(0, N)

assert (N - 1) != 0, 'N must be greater than 1'

if type_ == 'Bartlett':
win = (2 / (N - 1) * ((N - 1) / 2 - abs(n - (N - 1) / 2))).T
elif type_ == 'Bartlett-Hanning':
Expand Down

0 comments on commit 3c41b7a

Please sign in to comment.