Undescribed Horrific Abuse, One Victim & Survivor of Many gmkarl at gmail.com
Thu Nov 17 14:25:43 PST 2022

the sinusoid data actually has the same issue as the step function data.
the "real-domain" matrix produces output with some imaginary components added.

(Pdb) p freq_data @
create_freq2time(freqs=fftfreq(repetition_samples=4, complex=True))
array([0.04032738-2.47552542e-17j, 0.11657769-3.24912464e-17j,
       0.0633229 -2.75713933e-17j, 0.16327708-4.16797190e-17j])
(Pdb) p freq_data[:-1] @
create_freq2time(freqs=fftfreq(repetition_samples=4, complex=False))
array([0.04032738+2.33496941e-02j, 0.13992739-1.85659191e-17j,
       0.0633229 -2.33496941e-02j, 0.13992739-1.85659191e-17j])

so, why isn't an assertion catching this? maybe i don't test real-domain data?

actually, i do test this:
    rfreqs15t = fftfreq(repetition_samples=15, complex=False)
    rfreqs15f = fftfreq(15, complex=False)
    irft15 = create_freq2time(freqs=rfreqs15f)
    rft15 = create_time2freq(15, freqs=rfreqs15t)
    randvec2rtime15 = randvec[:15] @ irft15
    randvec2rfreq15 = randvec[:15] @ rft15
    randvec2irfft = np.fft.irfft(randvec[:15])
    randvec2rfft = np.fft.rfft(randvec[:15])
    assert np.allclose(rfreqs15t, np.fft.rfftfreq(15))
    assert np.allclose(rfreqs15f, np.fft.rfftfreq(28))
    assert np.allclose(randvec2rtime15, randvec2irfft)
    assert np.allclose(randvec2rfreq15, randvec2rfft)

onward to the passing assertions. 1725.

This was so hard to approach I am just quite satisfied to have added a
little more !!

More information about the cypherpunks mailing list