import unittest as _unittest
import numpy as _numpy
+try:
+ import matplotlib.pyplot as _pyplot
+except ImportError as e:
+ _pyplot = None
+ _pyplot_import_error = e
__version__ = '0.4'
expected[i] = 1.0 / _numpy.abs(a) * _numpy.sinc(f / a)
if TEST_PLOTS:
+ if _pyplot is None:
+ raise _pyplot_import_error
figure = _pyplot.figure()
time_axes = figure.add_subplot(2, 1, 1)
time_axes.plot(_numpy.arange(0, dt * samples, dt), x)
1.0 / a, _numpy.pi * f)
if TEST_PLOTS:
+ if _pyplot is None:
+ raise _pyplot_import_error
figure = _pyplot.figure()
time_axes = figure.add_subplot(2, 1, 1)
time_axes.plot(_numpy.arange(0, dt * samples, dt), x)
'The total power should be {} ({})'.format(Pexp, P))
if TEST_PLOTS:
+ if _pyplot is None:
+ raise _pyplot_import_error
figure = _pyplot.figure()
time_axes = figure.add_subplot(2, 1, 1)
time_axes.plot(
expected_amp, power[0]))
if TEST_PLOTS:
+ if _pyplot is None:
+ raise _pyplot_import_error
figure = _pyplot.figure()
time_axes = figure.add_subplot(2, 1, 1)
time_axes.plot(
expected[0], power[0]))
if TEST_PLOTS:
+ if _pyplot is None:
+ raise _pyplot_import_error
figure = _pyplot.figure()
time_axes = figure.add_subplot(2, 1, 1)
time_axes.plot(
'The total power should be {} ({})'.format(Pexp, P))
if TEST_PLOTS:
+ if _pyplot is None:
+ raise _pyplot_import_error
figure = _pyplot.figure()
time_axes = figure.add_subplot(2, 1, 1)
time_axes.plot(