summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
authorJosh Blum2009-10-28 16:17:24 -0700
committerJosh Blum2009-10-28 16:17:24 -0700
commit230e062e51d43f389520207cf147838c666a1f21 (patch)
treea8808807a56be99bdb9f926370c807725169e63d /gnuradio-core
parent0f688d959441909ec0c1c89ae279d670b2e3f6b2 (diff)
downloadgnuradio-230e062e51d43f389520207cf147838c666a1f21.tar.gz
gnuradio-230e062e51d43f389520207cf147838c666a1f21.tar.bz2
gnuradio-230e062e51d43f389520207cf147838c666a1f21.zip
Added window option to wxgui fft and waterfall sink.
Added rectangular window function to window.py. Average stays hidden in waterfall, fft, and numbersink wrappers (only avg_alpha shows/hides). Fixed options in waterfall wrapper to model after fft and numbersink average params.
Diffstat (limited to 'gnuradio-core')
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py6
-rw-r--r--gnuradio-core/src/python/gnuradio/window.py1
2 files changed, 5 insertions, 2 deletions
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py b/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py
index 7ef40be40..200c4cfbe 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py
+++ b/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py
@@ -28,7 +28,7 @@ class _logpwrfft_base(gr.hier_block2):
Create a log10(abs(fft)) stream chain, with real or complex input.
"""
- def __init__(self, sample_rate, fft_size, ref_scale, frame_rate, avg_alpha, average):
+ def __init__(self, sample_rate, fft_size, ref_scale, frame_rate, avg_alpha, average, win=None):
"""
Create an log10(abs(fft)) stream chain.
Provide access to the setting the filter and sample rate.
@@ -38,6 +38,7 @@ class _logpwrfft_base(gr.hier_block2):
@param frame_rate Output frame rate
@param avg_alpha FFT averaging (over time) constant [0.0-1.0]
@param average Whether to average [True, False]
+ @param win the window taps generation function
"""
gr.hier_block2.__init__(self, self._name,
gr.io_signature(1, 1, self._item_size), # Input signature
@@ -48,7 +49,8 @@ class _logpwrfft_base(gr.hier_block2):
vec_rate=frame_rate,
vec_len=fft_size)
- fft_window = window.blackmanharris(fft_size)
+ if win is None: win = window.blackmanharris
+ fft_window = win(fft_size)
fft = self._fft_block[0](fft_size, True, fft_window)
window_power = sum(map(lambda x: x*x, fft_window))
diff --git a/gnuradio-core/src/python/gnuradio/window.py b/gnuradio-core/src/python/gnuradio/window.py
index f89831375..7f6d62b7c 100644
--- a/gnuradio-core/src/python/gnuradio/window.py
+++ b/gnuradio-core/src/python/gnuradio/window.py
@@ -177,3 +177,4 @@ blackmanharris = coswindow((0.35875,0.48829,0.14128,0.01168))
nuttall = coswindow((0.3635819,0.4891775,0.1365995,0.0106411)) # Wikipedia calls this Blackman-Nuttall
nuttall_cfd = coswindow((0.355768,0.487396,0.144232,0.012604)) # Wikipedia calls this Nuttall, continuous first deriv
flattop = coswindow((1.0,1.93,1.29,0.388,0.032)) # Flat top window, coeffs from Wikipedia
+rectangular = lambda fft_size: [1]*fft_size