Skip to content

Commit

Permalink
Index chebyshev and jackson coefs by integers. Fixes #39 (#40)
Browse files Browse the repository at this point in the history
* Index chebyshev and jackson coefs by integers. Fixes #39
* initialize jackson chebyshev coefs by np.empty
  • Loading branch information
scottgigante authored and mdeff committed Jan 31, 2019
1 parent bca0fa8 commit a249343
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pygsp/filters/approximations.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,16 @@ def compute_jackson_cheby_coeff(filter_bounds, delta_lambda, m):
filter_bounds[1] = (filter_bounds[1]-a2)/a1

# First compute cheby coeffs
ch = np.arange(float(m+1))
ch = np.empty(m+1, dtype=float)
ch[0] = (2/(np.pi))*(np.arccos(filter_bounds[0])-np.arccos(filter_bounds[1]))
for i in ch[1:]:
for i in range(1, len(ch)):
ch[i] = (2/(np.pi * i)) * \
(np.sin(i * np.arccos(filter_bounds[0])) - np.sin(i * np.arccos(filter_bounds[1])))

# Then compute jackson coeffs
jch = np.arange(float(m+1))
jch = np.empty(m+1, dtype=float)
alpha = (np.pi/(m+2))
for i in jch:
for i in range(len(jch)):
jch[i] = (1/np.sin(alpha)) * \
((1 - i/(m+2)) * np.sin(alpha) * np.cos(i * alpha) +
(1/(m+2)) * np.cos(alpha) * np.sin(i * alpha))
Expand Down

0 comments on commit a249343

Please sign in to comment.