summaryrefslogtreecommitdiff
path: root/gr-qtgui/python/qtgui/bindings/freq_sink_f_python.cc
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-08-13 17:47:12 +0200
committermormj <34754695+mormj@users.noreply.github.com>2020-08-17 12:04:35 -0400
commitfdf04c1d1697f884fe0305881a59dfd3ded77c10 (patch)
tree1ac67415410b99b64d8dfeaa49b79bbe56b810f0 /gr-qtgui/python/qtgui/bindings/freq_sink_f_python.cc
parentdf17aeb1ae0dc9407c1b15c4329b6331dca59e8e (diff)
qtgui: freq_sink: Allow normalization of window functions
When switching between window functions in a live FFT GUI session, the difference in power of the window functions is notable. This allows asserting the 'normalize' argument of fft::window::build() by setting a bit in the window type during construction,, or by calling a new API call: set_fft_window_normalized(). Note: The choice to use an unused bit to set the normalization comes from an attempt to keep the API backward compatible. Adding a new argument to the make call would require reordering the make arguments. This feature allows changing window types without signal power varying due to window power differences. Note that this does not affect scalloping loss, or processing loss from the window. For example, the peak value of a sine tone will still vary for different windows, because different windows distribute the power differently, and most window functions move power to the sidelobes.
Diffstat (limited to 'gr-qtgui/python/qtgui/bindings/freq_sink_f_python.cc')
-rw-r--r--gr-qtgui/python/qtgui/bindings/freq_sink_f_python.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gr-qtgui/python/qtgui/bindings/freq_sink_f_python.cc b/gr-qtgui/python/qtgui/bindings/freq_sink_f_python.cc
index d753986f61..5ea96f3fe7 100644
--- a/gr-qtgui/python/qtgui/bindings/freq_sink_f_python.cc
+++ b/gr-qtgui/python/qtgui/bindings/freq_sink_f_python.cc
@@ -102,6 +102,11 @@ void bind_freq_sink_f(py::module& m)
.def("fft_window", &freq_sink_f::fft_window, D(freq_sink_f, fft_window))
+ .def("set_fft_window_normalized",
+ &freq_sink_f::set_fft_window_normalized,
+ D(freq_sink_f, set_fft_window_normalized))
+
+
.def("set_frequency_range",
&freq_sink_f::set_frequency_range,
py::arg("centerfreq"),