174 rfreqs15t = fftfreq(repetition_samples=15, complex=False) 175 rfreqs15f = fftfreq(15, complex=False) 176 irft15 = create_freq2time(freqs=rfreqs15f) 177 rft15 = create_time2freq(15, freqs=rfreqs15t) 178 randvec2rtime15 = randvec[:15] @ irft15 179 randvec2rfreq15 = randvec[:15] @ rft15 180 randvec2irfft = np.fft.irfft(randvec[:15]) 181 randvec2rfft = np.fft.rfft(randvec[:15]) 182 assert np.allclose(rfreqs15t, np.fft.rfftfreq(15)) 183 assert np.allclose(rfreqs15f, np.fft.rfftfreq(28)) 184 -> assert np.allclose(randvec2rtime15, randvec2irfft) 185 assert np.allclose(randvec2rfreq15, randvec2rfft) AssertionError Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program
/shared/src/scratch/fourier.py(184)test() -> assert np.allclose(randvec2rtime15, randvec2irfft)
For the frequency-to-time case, I'm guessing I can massage the matrix or the wavelet function in some simple manner to produce the right output, not sure. (Pdb) p randvec2rtime15 array([ 6.02864003e-01+0.00000000e+00j, 5.58328484e-03+3.78540383e-01j, 3.92172708e-05-2.86976335e-02j, 4.78542159e-02+9.61918533e-02j, 5.70841954e-02+1.27608079e-02j, 1.08246842e-02+1.21853206e-01j, -1.71864375e-02-2.09207363e-02j, 4.00709294e-02+4.69713689e-02j, 1.86474431e-02+7.08631802e-03j, -2.28384953e-03+7.67270253e-02j, -3.86887344e-02-6.78859201e-02j, 1.04829207e-01+1.97591142e-02j, -2.44517088e-02+4.59628083e-02j, 1.60843357e-02+1.96245569e-03j, -1.52256954e-02+5.27572826e-17j, 1.60843357e-02-1.96245569e-03j, -2.44517088e-02-4.59628083e-02j, 1.04829207e-01-1.97591142e-02j, -3.86887344e-02+6.78859201e-02j, -2.28384953e-03-7.67270253e-02j, 1.86474431e-02-7.08631802e-03j, 4.00709294e-02-4.69713689e-02j, -1.71864375e-02+2.09207363e-02j, 1.08246842e-02-1.21853206e-01j, 5.70841954e-02-1.27608079e-02j, 4.78542159e-02-9.61918533e-02j, 3.92172708e-05+2.86976335e-02j, 5.58328484e-03-3.78540383e-01j]) (Pdb) p randvec2irfft array([ 6.23788233e-01, -1.10813893e-02, -2.20954659e-02, 3.42088940e-02, 3.90241536e-02, -5.46560429e-03, -4.05515245e-02, 2.58696585e-02, -2.15808106e-03, -1.95104618e-02, -6.35896998e-02, 9.52535278e-02, -4.83357438e-02, 1.69736668e-04, -3.84507295e-02, 1.69736668e-04, -4.83357438e-02, 9.52535278e-02, -6.35896998e-02, -1.95104618e-02, -2.15808106e-03, 2.58696585e-02, -4.05515245e-02, -5.46560429e-03, 3.90241536e-02, 3.42088940e-02, -2.20954659e-02, -1.10813893e-02])