epfl-lts2 / pygsp

Graph Signal Processing in Python
https://pygsp.rtfd.io
BSD 3-Clause "New" or "Revised" License
483 stars 93 forks source link

Bugs in filter.py #6

Closed dsacc closed 7 years ago

dsacc commented 7 years ago

In evaluate() 'fd' is assigned two times, the first seems useless:

fd = np.zeros(x.size)
fd = self.g[i](x)
return fd

In filterbank_bounds() if 'bounds' is not provided it does:

if not hasattr(self.G, 'lmax'):
    self.logger.info('FILTERBANK_BOUNDS: Has to estimate lmax.')
    self.G.estimate_lmax()  

if not hasattr(self.G, 'e'):
    self.logger.info(
    'FILTERBANK_BOUNDS: Has to compute Fourier basis.')
    self.G.compute_fourier_basis()
     
rng = self.G.e

but compute_fourier_basis() in graph.py already sets 'lmax' when returning, so I think the first if block should be removed.


Hope it helps. Nice toolbox :+1:

mdeff commented 7 years ago

Thanks for pointing those out. First is evident. Second is reminiscent of the matlab version which may use lmax as xmax.