else:
return 0
-def _test_unitary_rfft_rect(a=1.0, time_shift=5.0, samp_freq=25.6, samples=256):
+def _test_unitary_rfft_rect(
+ a=1.0, time_shift=5.0, samp_freq=25.6, samples=256):
"Show fft(rect(at)) = 1/abs(a) * _numpy.sinc(f/a)"
samp_freq = _numpy.float(samp_freq)
a = _numpy.float(a)
def _gaussian(a, t):
return _numpy.exp(-a * t**2)
-def _test_unitary_rfft_gaussian(a=1.0, time_shift=5.0, samp_freq=25.6, samples=256):
+def _test_unitary_rfft_gaussian(
+ a=1.0, time_shift=5.0, samp_freq=25.6, samples=256):
"Show fft(rect(at)) = 1/abs(a) * sinc(f/a)"
samp_freq = _numpy.float(samp_freq)
a = _numpy.float(a)
return area/(std*_numpy.sqrt(2.0*_numpy.pi)) * _numpy.exp(
-0.5*((t-mean)/std)**2)
-def _test_unitary_power_spectrum_gaussian(area=2.5, mean=5, std=1, samp_freq=10.24 ,samples=512): #1024
+def _test_unitary_power_spectrum_gaussian(
+ area=2.5, mean=5, std=1, samp_freq=10.24 ,samples=512):
x = _numpy.zeros((samples,), dtype=_numpy.float)
mean = _numpy.float(mean)
for i in range(samples):
# The normalization approaches perfection as chunk_size -> infinity.
return (freq_axis, power)
-def _test_unitary_avg_power_spectrum_sin(sin_freq=10, samp_freq=512, samples=1024,
- chunk_size=512, overlap=True,
- window=window_hann):
+def _test_unitary_avg_power_spectrum_sin(
+ sin_freq=10, samp_freq=512, samples=1024, chunk_size=512, overlap=True,
+ window=window_hann):
x = _numpy.zeros((samples,), dtype=_numpy.float)
samp_freq = _numpy.float(samp_freq)
for i in range(samples):