enthought / blusky

BluSky
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

Cascade2d - with stride > 0 the result is wrong #18

Open blasscoc opened 5 years ago

blasscoc commented 5 years ago

If we decimate at each convolution, we need to also decimate the wavelets for the next order in the filter bank, otherwise the spectrum will be all messed up.

blasscoc commented 5 years ago

Go ahead and design an object that will implement a "downsampling" by the correct factors, at each step of the transform.

The scale of the finest wavelet will decimate by a factor of 2, then next by 4, etc.

The convolution with the father wavelet will decimate by a factor of 2^J.

Differ the actual implementation of the decimation scheme to a third object or function so we have some flexibility to develop.

blasscoc commented 5 years ago

From Kymatio; subsampling for convolution, signal with father wavelet: U_1_c = subsample_fourier(cdgmm(U_0_c, phi[0]), k=2**J)

Subsampling after application of convolution with \psi: U_1_c = subsample_fourier(U_1_c, k=2 ** j1)

Subsequent subsampling after application of convolution with father wavelet: U_2_c = subsample_fourier(cdgmm(U_1_c, phi[j1]), k=2**(J-j1))

Parameters

    x : tensor_like
        input tensor with at least 5 dimensions, the last being the real
         and imaginary parts.
        Ideally, the last dimension should be a power of 2 to avoid errors.
    k : int
        integer such that x is subsampled by 2**k along the spatial variables.
blasscoc commented 5 years ago

After second order convolution: if(j1 < j2): U_2_c = subsample_fourier(cdgmm(U_1_c, psi[n2][j1]), k=2 ** (j2-j1))

Convolving with father wavelet, after second order convolution: U_2_c = subsample_fourier(cdgmm(U_2_c, phi[j2]), k=2 ** (J-j2))