diff options
author | Jan Kraemer <kraemer.jn@gmail.com> | 2019-08-22 21:46:35 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2019-08-22 22:07:52 +0200 |
commit | 1c851e08973fbbdb50d7f551c9290f695adfd384 (patch) | |
tree | bf8bf7c88352f496f35b55c979cced660c100087 | |
parent | runtime: add msg ports to dot graph and use unique names (diff) | |
download | gnuradio-1c851e08973fbbdb50d7f551c9290f695adfd384.tar.xz gnuradio-1c851e08973fbbdb50d7f551c9290f695adfd384.zip |
Fixed gr_filter fftpack usage with numpy >= 1.17
-rw-r--r-- | gr-filter/python/filter/design/filter_design.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gr-filter/python/filter/design/filter_design.py b/gr-filter/python/filter/design/filter_design.py index 3748f4bab..ae7d8337a 100644 --- a/gr-filter/python/filter/design/filter_design.py +++ b/gr-filter/python/filter/design/filter_design.py @@ -34,7 +34,18 @@ from gnuradio import filter try: import numpy - from numpy.fft import fftpack + from numpy.fft import fftpack as fft_detail +except ImportError: + + print('Could not import fftpack, trying pocketfft') + # Numpy changed fft implementation in version 1.17 + # from fftpack to pocketfft + try: + from numpy.fft import pocketfft as fft_detail + except ImportError: + raise SystemExit('Could not import fft implementation of numpy') + +try: from scipy import poly1d, signal except ImportError: raise SystemExit('Please install SciPy to run this script (https://www.scipy.org)') @@ -985,7 +996,7 @@ class gr_plot_filter(QtGui.QMainWindow): def get_fft(self, fs, taps, Npts): Ts = 1.0 / fs - fftpts = fftpack.fft(taps, Npts) + fftpts = fft_detail.fft(taps, Npts) self.freq = numpy.arange(0, fs, 1.0 / (Npts*Ts)) with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") |