Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel_lowpass has arguments when being called in Expwin source code, what value for x is being passed? #49

Closed
shreyashi2104 opened this issue Apr 30, 2019 · 3 comments

Comments

@shreyashi2104
Copy link

shreyashi2104 commented Apr 30, 2019

Taken from expwin.py in pygsp:

`def kernel_lowpass(x):
return h(0.5 - x/G.lmax + band_max)
def kernel_highpass(x):
return h(0.5 + x/G.lmax - band_min)

    if (band_min is None) and (band_max is None):
        kernel = lambda x: np.ones_like(x)
    elif band_min is None:
        kernel = kernel_lowpass  #Here what value of x is being passed
    elif band_max is None:
        kernel = kernel_highpass  #Here what value of x is being passed
    else:
        kernel = lambda x: kernel_lowpass(x) * kernel_highpass(x)`

This doubt came to my mind when I wanted to use expwin as high pass filter for my graph. Is this a glitch?

@nperraud
Copy link
Collaborator

nperraud commented May 1, 2019

I am not sure I understand your concern. I just tested expwin and everything seems alright.

import numpy as np
from pygsp.filters import Expwin
from pygsp.graphs import Sensor
from matplotlib import pyplot as plt

N = 100
slope = 4
G = Sensor(N)
G.estimate_lmax()
f1 = filters.expwin.Expwin(G, band_min=None, band_max=0.4, slope=slope)
f2 = filters.expwin.Expwin(G, band_min=0.2, band_max=None, slope=slope)
f3 = filters.expwin.Expwin(G, band_min=0.2, band_max=0.4, slope=slope)
plt.figure(figsize=(15,4))
ax = plt.subplot(131)
f1.plot(ax=ax);
ax = plt.subplot(132)
f2.plot(ax=ax);
ax = plt.subplot(133)
f3.plot(ax=ax);

Please precise your concern.

@shreyashi2104
Copy link
Author

shreyashi2104 commented May 1, 2019 via email

@nperraud
Copy link
Collaborator

nperraud commented May 1, 2019

The function kernel_low pass is defined above taking the argument into account. I am closing the issue since this is not pygsp related.

@nperraud nperraud closed this as completed May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants