Ejemplo n.º 1
0
    # Display filter design in spectral domain
    sgwt.view_design(g,t,arange);

    # Chebyshev polynomial approximation
    m = 50 # Order of polynomial approximation
    print 'Computing Chebyshev polynomials of order %d for fast transform'  %m
    c = []
    for kernel in g:
        c.append(sgwt.cheby_coeff(kernel, m, m+1, arange))

    # Compute transform of delta at one vertex
    j_center = 32 - 1 # Vertex to center wavelets to be shown
    print 'Computing forward transform of delta at vertex %d' % j_center
    N = L.shape[0]
    d = sgwt.delta(N, j_center)
    # forward transform, using chebyshev approximation
    wp_all = sgwt.cheby_op(d, L, c, arange)

    ## plt.figure()
    ## print 'Plotting...'
    ## for i in range(N_scales + 1):
    ##     plt.subplot(N_scales + 1, 1, i+1)
    ##     plt.plot(wp_all[i])

    # Visualize result

    # Show original point
    cdict = { # Colormap
        'red': ((0., 0., 0.5), (0.5, 0.75, 1.), (1., 1. , 1.)),
        'green': ((0., 0., 0.5), (0.5, 0.15, 0.), (1., 0., 0.)),
Ejemplo n.º 2
0
l_max = sgwt.rough_l_max(L)
print 'Measuring the largest eigenvalue, l_max = %.2f' % l_max
print 'Designing transform in spectral domain'
(g, _, t) = sgwt.filter_design(l_max, N_scales)

arange = (0.0, l_max)

# Display filter design in spectral domain
#sgwt.view_design(g,t,arange);

# Chebyshev polynomial approximation
m = 50  # Order of polynomial approximation
print 'Computing Chebyshev polynomials of order %d for fast transform' % m
c = []
for kernel in g:
    c.append(sgwt.cheby_coeff(kernel, m, m + 1, arange))

# Compute transform of delta at one vertex
j_center = 135  # Vertex to center wavelets to be shown
print 'Computing forward transform of delta at vertex %d' % j_center
d = sgwt.delta(L.shape[0], j_center)
# forward transform, using chebyshev approximation
wp_all = sgwt.cheby_op(d, L, c, arange)

for n in range(N_scales + 1):
    alpha = wp_all[n].reshape((N, N))
    plt.matshow(alpha)
    plt.colorbar()

plt.show()
Ejemplo n.º 3
0
print 'Measuring the largest eigenvalue, l_max = %.2f' % l_max
print 'Designing transform in spectral domain'
(g, _, t) = sgwt.filter_design(l_max, N_scales)

arange = (0.0, l_max)

# Display filter design in spectral domain
#sgwt.view_design(g,t,arange);

# Chebyshev polynomial approximation
m = 50 # Order of polynomial approximation
print 'Computing Chebyshev polynomials of order %d for fast transform'  %m
c = []
for kernel in g:
    c.append(sgwt.cheby_coeff(kernel, m, m+1, arange))

# Compute transform of delta at one vertex
j_center = 135 # Vertex to center wavelets to be shown
print 'Computing forward transform of delta at vertex %d' % j_center
d = sgwt.delta(L.shape[0], j_center)
# forward transform, using chebyshev approximation
wp_all = sgwt.cheby_op(d, L, c, arange)


for n in range(N_scales + 1):
    alpha = wp_all[n].reshape((N,N))
    plt.matshow(alpha)
    plt.colorbar()

plt.show()