def test_fwt_iwt(self): for n in range(5, 11): input = np.zeros(n, dtype=np.float) input[0] = 1 _, coeff_slices = wavelet.get_wavelet_shape([n]) npt.assert_allclose( wavelet.iwt(wavelet.fwt(input), [n], coeff_slices), input)
def _apply(self, input): device = backend.get_device(input) with device: return wavelet.fwt(input, wave_name=self.wave_name, axes=self.axes, level=self.level)
def _apply(self, input): return wavelet.fwt(input, wave_name=self.wave_name, axes=self.axes, level=self.level)
def test_fwt(self): n = 8 input = np.zeros(n, dtype=np.float) input[0] = 1 npt.assert_allclose(wavelet.fwt(input, level=1, wave_name='haar'), [1 / 2**0.5, 0, 0, 0, 1 / 2**0.5, 0, 0, 0])