return num
def _test_rfft(xs, Xs) :
- print "Test numpy rfft definition"
# Numpy's FFT algoritm returns
# n-1
# X[k] = SUM x[m] exp (-j 2pi km /n)
"Mismatch on Parseval's, %g != 1/%d * %g" % (timeSum, n, freqSum)
def _test_rfft_suite() :
+ print "Test numpy rfft definition"
xs = [1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1]
_test_rfft(xs, rfft(xs))
return (freq_axis, trans)
def _test_unitary_rfft_parsevals(xs, freq, freqs, Xs):
- print "Test unitary rfft on Parseval's theorem"
# Which should satisfy the discretized integral form of Parseval's theorem
# n-1 n-1
# SUM |x_m|^2 dt = SUM |X_k|^2 df
% (lhs, rhs)
def _test_unitary_rfft_parsevals_suite():
+ print "Test unitary rfft on Parseval's theorem"
xs = [1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1]
dt = pi
freqs,Xs = unitary_rfft(xs, 1.0/dt)
t = i*dt
x[i] = _rect(a*(t-time_shift))
freq_axis, X = unitary_rfft(x, samp_freq)
+ #_test_unitary_rfft_parsevals(x, samp_freq, freq_axis, X)
# remove the phase due to our time shift
j = complex(0.0,1.0) # sqrt(-1)
t = i*dt
x[i] = _gaussian(a, (t-time_shift))
freq_axis, X = unitary_rfft(x, samp_freq)
+ #_test_unitary_rfft_parsevals(x, samp_freq, freq_axis, X)
# remove the phase due to our time shift
j = complex(0.0,1.0) # sqrt(-1)